diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_arithmetic.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_arithmetic.test.cpp index 7cbe434b84dd..6c9a54d811cd 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_arithmetic.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_arithmetic.test.cpp @@ -404,7 +404,7 @@ TEST_F(AvmArithmeticTestsFF, subtraction) EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic multiplication over finite field type. @@ -424,7 +424,7 @@ TEST_F(AvmArithmeticTestsFF, multiplication) EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on multiplication by zero over finite field type. @@ -444,7 +444,7 @@ TEST_F(AvmArithmeticTestsFF, multiplicationByZero) EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic division over finite field type. @@ -467,7 +467,7 @@ TEST_F(AvmArithmeticTestsFF, fDivision) EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); EXPECT_EQ(row->avm_main_rwc, FF(1)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on division with zero numerator over finite field type. @@ -490,7 +490,7 @@ TEST_F(AvmArithmeticTestsFF, fDivisionNumeratorZero) EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); EXPECT_EQ(row->avm_main_rwc, FF(1)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on division by zero over finite field type. @@ -515,7 +515,7 @@ TEST_F(AvmArithmeticTestsFF, fDivisionByZeroError) EXPECT_EQ(row->avm_main_rwc, FF(1)); EXPECT_EQ(row->avm_main_op_err, FF(1)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on division of zero by zero over finite field type. @@ -538,7 +538,7 @@ TEST_F(AvmArithmeticTestsFF, fDivisionZeroByZeroError) EXPECT_EQ(row->avm_main_rwc, FF(1)); EXPECT_EQ(row->avm_main_op_err, FF(1)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Testing an execution of the different arithmetic opcodes over finite field @@ -580,7 +580,7 @@ TEST_F(AvmArithmeticTestsFF, equality) EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); // Expect 0 as inv of (q-1) - (q-1) - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test correct non-equality of FF elements @@ -597,7 +597,7 @@ TEST_F(AvmArithmeticTestsFF, nonEquality) EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(-1).invert()); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } TEST_P(AvmArithmeticTestsDiv, division) @@ -613,7 +613,7 @@ TEST_P(AvmArithmeticTestsDiv, division) common_validate_div(trace, a, b, output, 0, 1, 2, mem_tag); // auto alu_row = trace.at(alu_row_index); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } INSTANTIATE_TEST_SUITE_P(AvmArithmeticTestsDiv, AvmArithmeticTestsDiv, @@ -640,7 +640,7 @@ TEST_F(AvmArithmeticTests, DivisionByZeroError) EXPECT_EQ(row->avm_main_rwc, FF(1)); EXPECT_EQ(row->avm_main_op_err, FF(1)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } /****************************************************************************** @@ -665,7 +665,7 @@ TEST_F(AvmArithmeticTestsU8, addition) EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(91)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic addition over u8 type with carry. @@ -687,7 +687,7 @@ TEST_F(AvmArithmeticTestsU8, additionCarry) EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(3)); EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(1)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic subtraction over u8 type. @@ -708,7 +708,7 @@ TEST_F(AvmArithmeticTestsU8, subtraction) EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(133)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on subtraction over u8 type with carry. @@ -738,7 +738,7 @@ TEST_F(AvmArithmeticTestsU8, subtractionCarry) EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic multiplication over u8 type. @@ -761,7 +761,7 @@ TEST_F(AvmArithmeticTestsU8, multiplication) EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(195)); EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on multiplication over u8 type with overflow. @@ -785,7 +785,7 @@ TEST_F(AvmArithmeticTestsU8, multiplicationOverflow) EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(208)); EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(132)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test of equality on u8 elements @@ -798,7 +798,7 @@ TEST_F(AvmArithmeticTestsU8, equality) EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test correct non-equality of U8 elements @@ -811,7 +811,7 @@ TEST_F(AvmArithmeticTestsU8, nonEquality) EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(-116).invert()); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } /****************************************************************************** @@ -837,7 +837,7 @@ TEST_F(AvmArithmeticTestsU16, addition) EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xDC)); // 34780 = 0x87DC EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x87)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic addition over u16 type with carry. @@ -859,7 +859,7 @@ TEST_F(AvmArithmeticTestsU16, additionCarry) EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(17)); EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic subtraction over u16 type. @@ -882,7 +882,7 @@ TEST_F(AvmArithmeticTestsU16, subtraction) EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x79)); EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic subtraction over u16 type with carry. @@ -912,7 +912,7 @@ TEST_F(AvmArithmeticTestsU16, subtractionCarry) EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic multiplication over u16 type. @@ -937,7 +937,7 @@ TEST_F(AvmArithmeticTestsU16, multiplication) EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0xBF)); EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on multiplication over u16 type with overflow. @@ -963,7 +963,7 @@ TEST_F(AvmArithmeticTestsU16, multiplicationOverflow) EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(8)); EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test of equality on U16 elements @@ -976,7 +976,7 @@ TEST_F(AvmArithmeticTestsU16, equality) EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test correct non-equality of U16 elements @@ -989,7 +989,7 @@ TEST_F(AvmArithmeticTestsU16, nonEquality) EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(-14'300).invert()); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } /****************************************************************************** @@ -1016,7 +1016,7 @@ TEST_F(AvmArithmeticTestsU32, addition) EXPECT_EQ(alu_row.avm_alu_u8_r1, FF((2234567891LLU >> 8) & UINT8_MAX)); EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(2234567891LLU >> 16)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic addition over u32 type with carry. @@ -1038,7 +1038,7 @@ TEST_F(AvmArithmeticTestsU32, additionCarry) EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(231)); // 999 = 3 * 256 + 231 EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(3)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic subtraction over u32 type. @@ -1064,7 +1064,7 @@ TEST_F(AvmArithmeticTestsU32, subtraction) EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0x69F)); EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic subtraction over u32 type with carry. @@ -1096,7 +1096,7 @@ TEST_F(AvmArithmeticTestsU32, subtractionCarry) EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic multiplication over u32 type. @@ -1125,7 +1125,7 @@ TEST_F(AvmArithmeticTestsU32, multiplication) EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0)); EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on multiplication over u32 type with overflow. @@ -1154,7 +1154,7 @@ TEST_F(AvmArithmeticTestsU32, multiplicationOverflow) EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(71)); EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test of equality on U32 elements @@ -1168,7 +1168,7 @@ TEST_F(AvmArithmeticTestsU32, equality) EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test correct non-equality of U32 elements @@ -1182,7 +1182,7 @@ TEST_F(AvmArithmeticTestsU32, nonEquality) EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(1).invert()); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } /****************************************************************************** @@ -1216,7 +1216,7 @@ TEST_F(AvmArithmeticTestsU64, addition) EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0x3684)); EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0x24)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic addition over u64 type with carry. @@ -1244,7 +1244,7 @@ TEST_F(AvmArithmeticTestsU64, additionCarry) EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(UINT16_MAX)); EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(UINT16_MAX)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic subtraction over u64 type. @@ -1275,7 +1275,7 @@ TEST_F(AvmArithmeticTestsU64, subtraction) EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0X23)); EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic subtraction over u64 type with carry. @@ -1308,7 +1308,7 @@ TEST_F(AvmArithmeticTestsU64, subtractionCarry) EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(UINT16_MAX)); EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic multiplication over u64 type. @@ -1337,7 +1337,7 @@ TEST_F(AvmArithmeticTestsU64, multiplication) EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0x7B5)); EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on multiplication over u64 type with overflow. @@ -1372,7 +1372,7 @@ TEST_F(AvmArithmeticTestsU64, multiplicationOverflow) EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } TEST_F(AvmArithmeticTestsU64, equality) @@ -1385,7 +1385,7 @@ TEST_F(AvmArithmeticTestsU64, equality) EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test correct non-equality of U64 elements @@ -1399,7 +1399,7 @@ TEST_F(AvmArithmeticTestsU64, nonEquality) EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0x510000).invert()); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } /****************************************************************************** @@ -1442,7 +1442,7 @@ TEST_F(AvmArithmeticTestsU128, addition) EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(0x4444)); EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(0x8888)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic addition over u128 type with carry. @@ -1482,7 +1482,7 @@ TEST_F(AvmArithmeticTestsU128, additionCarry) EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(0xFFFF)); EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(0xFFFF)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic subtraction over u128 type. @@ -1524,7 +1524,7 @@ TEST_F(AvmArithmeticTestsU128, subtraction) EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(0)); EXPECT_EQ(alu_row.avm_alu_u16_r7, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic subtraction over u128 type with carry. @@ -1564,7 +1564,7 @@ TEST_F(AvmArithmeticTestsU128, subtractionCarry) EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(0)); EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(0x2222)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on basic multiplication over u128 type. @@ -1600,7 +1600,7 @@ TEST_F(AvmArithmeticTestsU128, multiplication) EXPECT_EQ(alu_row_second.avm_alu_u16_r0, FF(0x762C)); EXPECT_EQ(alu_row_second.avm_alu_u16_r1, FF(0xF92C)); EXPECT_EQ(alu_row_second.avm_alu_u16_r2, FF(0x1)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test on multiplication over u128 type with overflow. @@ -1668,7 +1668,7 @@ TEST_F(AvmArithmeticTestsU128, multiplicationOverflow) // CF EXPECT_EQ(alu_row_first.avm_alu_cf, FF(1)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } TEST_F(AvmArithmeticTestsU128, equality) @@ -1688,7 +1688,7 @@ TEST_F(AvmArithmeticTestsU128, equality) EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Test correct non-equality of U128 elements @@ -1710,7 +1710,7 @@ TEST_F(AvmArithmeticTestsU128, nonEquality) EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0xdeadbeefLLU << 32).invert()); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } /****************************************************************************** diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp index e84359e8e19c..9e52825df4b3 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp @@ -479,7 +479,7 @@ TEST_P(AvmBitwiseTestsNot, ParamTest) FF ff_a = FF(uint256_t::from_uint128(a)); FF ff_output = FF(uint256_t::from_uint128(output)); common_validate_op_not(trace, ff_a, ff_output, FF(0), FF(1), mem_tag); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests, @@ -514,7 +514,7 @@ TEST_P(AvmBitwiseTestsOr, AllOrTest) auto trace = trace_builder.finalize(); common_validate_bit_op(trace, 1, a, b, output, FF(0), FF(1), FF(2), mem_tag); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests, AvmBitwiseTestsOr, @@ -531,7 +531,7 @@ TEST_P(AvmBitwiseTestsXor, AllXorTest) auto trace = trace_builder.finalize(); common_validate_bit_op(trace, 2, a, b, output, FF(0), FF(1), FF(2), mem_tag); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests, @@ -548,7 +548,7 @@ TEST_P(AvmBitwiseTestsShr, AllShrTest) trace_builder.return_op(0, 2, 1); auto trace = trace_builder.finalize(); common_validate_shift_op(trace, a, b, output, FF(0), FF(1), FF(2), mem_tag, true); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests, @@ -566,7 +566,7 @@ TEST_P(AvmBitwiseTestsShl, AllShlTest) auto trace = trace_builder.finalize(); common_validate_shift_op(trace, a, b, output, FF(0), FF(1), FF(2), mem_tag, false); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests, diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp index 2c9acd96642c..245a4f2f2821 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp @@ -118,7 +118,7 @@ class AvmCastTests : public ::testing::Test { if (force_proof) { validate_trace(std::move(trace), public_inputs, true); } else { - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } } }; @@ -248,7 +248,7 @@ TEST_F(AvmCastTests, indirectAddrWrongResolutionU64ToU8) Field("alu_sel", &Row::avm_main_alu_sel, 0), // ALU trace not activated Field("tag_err", &Row::avm_main_tag_err, 1))); // Error activated - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } TEST_F(AvmCastNegativeTests, nonTruncatedOutputMainIc) diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_comparison.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_comparison.test.cpp index fce886c26f0f..8530fa19c209 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_comparison.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_comparison.test.cpp @@ -130,7 +130,7 @@ TEST_P(AvmCmpTestsLT, ParamTest) ASSERT_TRUE(alu_row != trace.end()); common_validate_cmp(*row, *alu_row, a, b, c, FF(0), FF(1), FF(2), mem_tag); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } INSTANTIATE_TEST_SUITE_P(AvmCmpTests, AvmCmpTestsLT, @@ -159,7 +159,7 @@ TEST_P(AvmCmpTestsLTE, ParamTest) ASSERT_TRUE(row != trace.end()); ASSERT_TRUE(alu_row != trace.end()); common_validate_cmp(*row, *alu_row, a, b, c, FF(0), FF(1), FF(2), mem_tag); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } INSTANTIATE_TEST_SUITE_P(AvmCmpTests, AvmCmpTestsLTE, diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_control_flow.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_control_flow.test.cpp index e95d198e280f..3bf8ad942d6a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_control_flow.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_control_flow.test.cpp @@ -124,7 +124,7 @@ TEST_F(AvmControlFlowTests, simpleJump) EXPECT_TRUE(halt_row != trace.end()); EXPECT_EQ(halt_row->avm_main_pc, FF(JUMP_PC)); } - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } TEST_F(AvmControlFlowTests, simpleCallAndReturn) @@ -171,7 +171,7 @@ TEST_F(AvmControlFlowTests, simpleCallAndReturn) EXPECT_EQ(halt_row->avm_main_pc, FF(RETURN_PC)); } - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } TEST_F(AvmControlFlowTests, multipleCallsAndReturns) @@ -304,6 +304,6 @@ TEST_F(AvmControlFlowTests, multipleCallsAndReturns) EXPECT_TRUE(halt_row != trace.end()); EXPECT_EQ(halt_row->avm_main_pc, FF(1)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } } // namespace tests_avm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp index aa0e7be7005b..bfa5339d3621 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp @@ -11,9 +11,6 @@ #include #include -// TODO: remove -#include "barretenberg/vm/avm_trace/avm_helper.cpp" - namespace tests_avm { using namespace bb; using namespace bb::avm_trace; @@ -23,7 +20,8 @@ using bb::utils::hex_to_bytes; class AvmExecutionTests : public ::testing::Test { public: - std::vector public_inputs_vec{}; + std::vector public_inputs_vec; + VmPublicInputs public_inputs; AvmExecutionTests() : public_inputs_vec(PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH){}; @@ -35,6 +33,7 @@ class AvmExecutionTests : public ::testing::Test { srs::init_crs_factory("../srs_db/ignition"); public_inputs_vec.at(DA_START_GAS_LEFT_PCPI_OFFSET) = DEFAULT_INITIAL_DA_GAS; public_inputs_vec.at(L2_START_GAS_LEFT_PCPI_OFFSET) = DEFAULT_INITIAL_L2_GAS; + public_inputs = Execution::convert_public_inputs(public_inputs_vec); }; /** @@ -48,6 +47,13 @@ class AvmExecutionTests : public ::testing::Test { std::vector calldata{}; return Execution::gen_trace(instructions, calldata, public_inputs_vec); } + + void feed_output(uint32_t output_offset, FF const& value, FF const& side_effect_counter, FF const& metadata) + { + std::get(public_inputs)[output_offset] = value; + std::get(public_inputs)[output_offset] = side_effect_counter; + std::get(public_inputs)[output_offset] = metadata; + }; }; // Basic positive test with an ADD and RETURN opcode. @@ -88,7 +94,7 @@ TEST_F(AvmExecutionTests, basicAddReturn) ElementsAre(VariantWith(0), VariantWith(0), VariantWith(0))))); auto trace = gen_trace_from_instr(instructions); - validate_trace(std::move(trace), Execution::convert_public_inputs(public_inputs_vec), true); + validate_trace(std::move(trace), public_inputs, true); } // Positive test for SET and SUB opcodes @@ -153,7 +159,7 @@ TEST_F(AvmExecutionTests, setAndSubOpcodes) // Find the first row enabling the subtraction selector auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sub == 1; }); EXPECT_EQ(row->avm_main_ic, 10000); // 47123 - 37123 = 10000 - validate_trace(std::move(trace), Execution::convert_public_inputs(public_inputs_vec), true); + validate_trace(std::move(trace), public_inputs, true); } // Positive test for multiple MUL opcodes @@ -233,7 +239,7 @@ TEST_F(AvmExecutionTests, powerWithMulOpcodes) trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_mul == 1 && r.avm_main_pc == 13; }); EXPECT_EQ(row->avm_main_ic, 244140625); // 5^12 = 244140625 - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test about a single internal_call and internal_return @@ -300,7 +306,7 @@ TEST_F(AvmExecutionTests, simpleInternalCall) auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_add == 1; }); EXPECT_EQ(row->avm_main_ic, 345567789); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test with some nested internall calls @@ -380,7 +386,7 @@ TEST_F(AvmExecutionTests, nestedInternalCalls) EXPECT_EQ(row->avm_main_ic, 187); EXPECT_EQ(row->avm_main_pc, 4); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test with JUMP and CALLDATACOPY @@ -455,7 +461,7 @@ TEST_F(AvmExecutionTests, jumpAndCalldatacopy) // It must have failed as subtraction was "jumped over". EXPECT_EQ(row, trace.end()); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test for JUMPI. @@ -550,8 +556,8 @@ TEST_F(AvmExecutionTests, jumpiAndCalldatacopy) EXPECT_EQ(row->avm_main_ic, 1600); // 800 = (20 + 20) * (20 + 20) // traces validation - validate_trace(std::move(trace_jump)); - validate_trace(std::move(trace_no_jump)); + validate_trace(std::move(trace_jump), public_inputs); + validate_trace(std::move(trace_no_jump), public_inputs); } // Positive test with MOV. @@ -599,7 +605,7 @@ TEST_F(AvmExecutionTests, movOpcode) EXPECT_EQ(row->avm_main_ia, 19); EXPECT_EQ(row->avm_main_ic, 19); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test with CMOV. @@ -655,7 +661,7 @@ TEST_F(AvmExecutionTests, cmovOpcode) EXPECT_EQ(row->avm_main_ic, 3); EXPECT_EQ(row->avm_main_id, 5); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test with indirect MOV. @@ -703,7 +709,7 @@ TEST_F(AvmExecutionTests, indMovOpcode) EXPECT_EQ(row->avm_main_ia, 255); EXPECT_EQ(row->avm_main_ic, 255); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test for SET and CAST opcodes @@ -744,7 +750,7 @@ TEST_F(AvmExecutionTests, setAndCastOpcodes) auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_cast == 1; }); EXPECT_EQ(row->avm_main_ic, 19); // 0XB813 --> 0X13 = 19 - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test with TO_RADIX_LE. @@ -816,7 +822,7 @@ TEST_F(AvmExecutionTests, toRadixLeOpcode) } EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // // Positive test with SHA256COMPRESSION. @@ -909,7 +915,7 @@ TEST_F(AvmExecutionTests, sha256CompressionOpcode) EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test with SHA256 @@ -1002,7 +1008,7 @@ TEST_F(AvmExecutionTests, sha256Opcode) EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test with POSEIDON2_PERM. @@ -1073,7 +1079,7 @@ TEST_F(AvmExecutionTests, poseidon2PermutationOpCode) EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test with Keccakf1600. @@ -1172,7 +1178,7 @@ TEST_F(AvmExecutionTests, keccakf1600OpCode) EXPECT_EQ(row->avm_main_ib, 25); // Input length EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test with Keccak. @@ -1255,7 +1261,7 @@ TEST_F(AvmExecutionTests, keccakOpCode) EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test with Pedersen. @@ -1329,7 +1335,7 @@ TEST_F(AvmExecutionTests, pedersenHashOpCode) EXPECT_EQ(returndata[0], expected_output); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // // Positive test with EmbeddedCurveAdd @@ -1391,7 +1397,7 @@ TEST_F(AvmExecutionTests, embeddedCurveAddOpCode) EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test for Kernel Input opcodes @@ -1599,7 +1605,7 @@ TEST_F(AvmExecutionTests, kernelInputOpcodes) // std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_coinbase == 1; }); // EXPECT_EQ(coinbase_row->avm_main_ia, coinbase); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), Execution::convert_public_inputs(public_inputs_vec)); } // Positive test for L2GASLEFT opcode @@ -1639,7 +1645,7 @@ TEST_F(AvmExecutionTests, l2GasLeft) EXPECT_EQ(row->avm_main_ia, expected_rem_gas); EXPECT_EQ(row->avm_main_mem_idx_a, 257); // Resolved direct address: 257 - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Positive test for DAGASLEFT opcode @@ -1680,7 +1686,7 @@ TEST_F(AvmExecutionTests, daGasLeft) EXPECT_EQ(row->avm_main_ia, expected_rem_gas); EXPECT_EQ(row->avm_main_mem_idx_a, 39); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Should throw whenever the wrong number of public inputs are provided @@ -1718,13 +1724,13 @@ TEST_F(AvmExecutionTests, kernelOutputEmitOpcodes) + to_hex(OpCode::EMITNOTEHASH) + // opcode EMITNOTEHASH "00" // Indirect flag "00000001" // src offset 1 - + to_hex(OpCode::EMITNULLIFIER) + // opcode EMITNOTEHASH + + to_hex(OpCode::EMITNULLIFIER) + // opcode EMITNULLIFIER "00" // Indirect flag "00000001" // src offset 1 - + to_hex(OpCode::EMITUNENCRYPTEDLOG) + // opcode EMITNOTEHASH + + to_hex(OpCode::EMITUNENCRYPTEDLOG) + // opcode EMITUNENCRYPTEDLOG "00" // Indirect flag "00000001" // src offset 1 - + to_hex(OpCode::SENDL2TOL1MSG) + // opcode EMITNOTEHASH + + to_hex(OpCode::SENDL2TOL1MSG) + // opcode SENDL2TOL1MSG "00" // Indirect flag "00000001" // src offset 1 "00000001" // src offset 1 @@ -1755,6 +1761,7 @@ TEST_F(AvmExecutionTests, kernelOutputEmitOpcodes) trace.begin(), trace.end(), [&](Row r) { return r.avm_main_clk == emit_note_hash_out_offset; }); EXPECT_EQ(emit_note_hash_kernel_out_row->avm_kernel_kernel_value_out, 1); EXPECT_EQ(emit_note_hash_kernel_out_row->avm_kernel_kernel_side_effect_out, 0); + feed_output(emit_note_hash_out_offset, 1, 0, 0); // CHECK EMIT NULLIFIER auto emit_nullifier_row = @@ -1767,6 +1774,7 @@ TEST_F(AvmExecutionTests, kernelOutputEmitOpcodes) trace.begin(), trace.end(), [&](Row r) { return r.avm_main_clk == emit_nullifier_out_offset; }); EXPECT_EQ(emit_nullifier_kernel_out_row->avm_kernel_kernel_value_out, 1); EXPECT_EQ(emit_nullifier_kernel_out_row->avm_kernel_kernel_side_effect_out, 1); + feed_output(emit_nullifier_out_offset, 1, 1, 0); // CHECK EMIT UNENCRYPTED LOG auto emit_log_row = std::ranges::find_if( @@ -1779,6 +1787,7 @@ TEST_F(AvmExecutionTests, kernelOutputEmitOpcodes) std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.avm_main_clk == emit_log_out_offset; }); EXPECT_EQ(emit_log_kernel_out_row->avm_kernel_kernel_value_out, 1); EXPECT_EQ(emit_log_kernel_out_row->avm_kernel_kernel_side_effect_out, 2); + feed_output(emit_log_out_offset, 1, 2, 0); // CHECK SEND L2 TO L1 MSG auto send_row = std::ranges::find_if( @@ -1793,8 +1802,9 @@ TEST_F(AvmExecutionTests, kernelOutputEmitOpcodes) EXPECT_EQ(msg_out_row->avm_kernel_kernel_value_out, 1); EXPECT_EQ(msg_out_row->avm_kernel_kernel_side_effect_out, 3); EXPECT_EQ(msg_out_row->avm_kernel_kernel_metadata_out, 1); + feed_output(AvmKernelTraceBuilder::START_L2_TO_L1_MSG_WRITE_OFFSET, 1, 3, 1); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // SLOAD @@ -1851,8 +1861,8 @@ TEST_F(AvmExecutionTests, kernelOutputStorageLoadOpcodeSimple) EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_value_out, 42); // value EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_side_effect_out, 0); EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_metadata_out, 9); // slot - - validate_trace(std::move(trace)); + feed_output(sload_out_offset, 42, 0, 9); + validate_trace(std::move(trace), public_inputs); } // SLOAD @@ -1918,7 +1928,10 @@ TEST_F(AvmExecutionTests, kernelOutputStorageLoadOpcodeComplex) EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_side_effect_out, 1); EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_metadata_out, 10); // slot - validate_trace(std::move(trace)); + feed_output(sload_out_offset, 42, 0, 9); + feed_output(sload_out_offset + 1, 123, 1, 10); + + validate_trace(std::move(trace), public_inputs); } // SSTORE @@ -1960,11 +1973,16 @@ TEST_F(AvmExecutionTests, kernelOutputStorageStoreOpcodeSimple) uint32_t sstore_out_offset = AvmKernelTraceBuilder::START_SSTORE_WRITE_OFFSET; auto sstore_kernel_out_row = std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.avm_main_clk == sstore_out_offset; }); - EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_value_out, 42); // value - EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_side_effect_out, 0); - EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_metadata_out, 9); // slot - validate_trace(std::move(trace)); + auto value_out = sstore_kernel_out_row->avm_kernel_kernel_value_out; + auto side_effect_out = sstore_kernel_out_row->avm_kernel_kernel_side_effect_out; + auto metadata_out = sstore_kernel_out_row->avm_kernel_kernel_metadata_out; + EXPECT_EQ(value_out, 42); // value + EXPECT_EQ(side_effect_out, 0); + EXPECT_EQ(metadata_out, 9); // slot + + feed_output(sstore_out_offset, value_out, side_effect_out, metadata_out); + validate_trace(std::move(trace), public_inputs); } // SSTORE @@ -2024,7 +2042,10 @@ TEST_F(AvmExecutionTests, kernelOutputStorageStoreOpcodeComplex) EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_side_effect_out, 1); EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_metadata_out, 10); // slot - validate_trace(std::move(trace)); + feed_output(sstore_out_offset, 42, 0, 9); + feed_output(sstore_out_offset + 1, 123, 1, 10); + + validate_trace(std::move(trace), public_inputs); } // SLOAD and SSTORE @@ -2086,6 +2107,7 @@ TEST_F(AvmExecutionTests, kernelOutputStorageOpcodes) EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_value_out, 42); // value EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_side_effect_out, 0); EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_metadata_out, 9); // slot + feed_output(sload_out_offset, 42, 0, 9); // CHECK SSTORE auto sstore_row = @@ -2101,8 +2123,9 @@ TEST_F(AvmExecutionTests, kernelOutputStorageOpcodes) EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_value_out, 42); // value EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_side_effect_out, 1); EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_metadata_out, 9); // slot + feed_output(sstore_out_offset, 42, 1, 9); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } TEST_F(AvmExecutionTests, kernelOutputHashExistsOpcodes) @@ -2165,6 +2188,7 @@ TEST_F(AvmExecutionTests, kernelOutputHashExistsOpcodes) EXPECT_EQ(note_hash_out_row->avm_kernel_kernel_value_out, 1); // value EXPECT_EQ(note_hash_out_row->avm_kernel_kernel_side_effect_out, 0); EXPECT_EQ(note_hash_out_row->avm_kernel_kernel_metadata_out, 1); // exists + feed_output(AvmKernelTraceBuilder::START_NOTE_HASH_EXISTS_WRITE_OFFSET, 1, 0, 1); // CHECK NULLIFIEREXISTS auto nullifier_row = @@ -2179,6 +2203,7 @@ TEST_F(AvmExecutionTests, kernelOutputHashExistsOpcodes) EXPECT_EQ(nullifier_out_row->avm_kernel_kernel_value_out, 1); // value EXPECT_EQ(nullifier_out_row->avm_kernel_kernel_side_effect_out, 1); EXPECT_EQ(nullifier_out_row->avm_kernel_kernel_metadata_out, 1); // exists + feed_output(AvmKernelTraceBuilder::START_NULLIFIER_EXISTS_OFFSET, 1, 1, 1); // CHECK L1TOL2MSGEXISTS auto l1_to_l2_row = std::ranges::find_if( @@ -2193,8 +2218,9 @@ TEST_F(AvmExecutionTests, kernelOutputHashExistsOpcodes) EXPECT_EQ(msg_out_row->avm_kernel_kernel_value_out, 1); // value EXPECT_EQ(msg_out_row->avm_kernel_kernel_side_effect_out, 2); EXPECT_EQ(msg_out_row->avm_kernel_kernel_metadata_out, 1); // exists + feed_output(AvmKernelTraceBuilder::START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET, 1, 2, 1); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // TEST_F(AvmExecutionTests, opCallOpcodes) @@ -2233,7 +2259,8 @@ TEST_F(AvmExecutionTests, kernelOutputHashExistsOpcodes) // "03" // U32 // "00000002" // val i // "00000007"; -// std::string bytecode_hex = bytecode_preamble // SET gas, addr, args size, ret offset, success, function selector +// std::string bytecode_hex = bytecode_preamble // SET gas, addr, args size, ret offset, success, function +// selector // + to_hex(OpCode::CALL) + // opcode CALL // "15" // Indirect flag // "00000000" // gas offset @@ -2262,7 +2289,7 @@ TEST_F(AvmExecutionTests, kernelOutputHashExistsOpcodes) // auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec, execution_hints); // EXPECT_EQ(returndata, std::vector({ 9, 8, 1 })); // The 1 represents the success -// validate_trace(std::move(trace)); +// validate_trace(std::move(trace), public_inputs); // } TEST_F(AvmExecutionTests, opGetContractInstanceOpcodes) @@ -2301,7 +2328,7 @@ TEST_F(AvmExecutionTests, opGetContractInstanceOpcodes) auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec, execution_hints); EXPECT_EQ(returndata, std::vector({ 1, 2, 3, 4, 5, 6 })); // The first one represents true - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Negative test detecting an invalid opcode byte. TEST_F(AvmExecutionTests, invalidOpcode) diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_indirect_mem.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_indirect_mem.test.cpp index 35d2a523b7dd..ac6e29fb9d77 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_indirect_mem.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_indirect_mem.test.cpp @@ -119,7 +119,7 @@ TEST_F(AvmIndirectMemTests, indirectOutputSub) EXPECT_EQ(row->avm_main_mem_op_b, FF(1)); EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Testing a multiplication operation with indirect input operand a, @@ -165,7 +165,7 @@ TEST_F(AvmIndirectMemTests, indirectInputAMul) EXPECT_EQ(row->avm_main_mem_op_b, FF(1)); EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } } // namespace tests_avm diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp index ff144974512f..e1dea4420ed8 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp @@ -232,7 +232,7 @@ class AvmMemOpcodeTests : public ::testing::Test { Field(&Row::avm_mem_ind_op_c, 1))); } - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } void common_cmov_trace_validate(bool indirect, @@ -540,7 +540,7 @@ TEST_F(AvmMemOpcodeTests, directSet) Field(&Row::avm_mem_rw, 1), Field(&Row::avm_mem_ind_op_c, 0))); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } TEST_F(AvmMemOpcodeTests, indirectSet) @@ -580,7 +580,7 @@ TEST_F(AvmMemOpcodeTests, indirectSet) Field(&Row::avm_mem_r_in_tag, static_cast(AvmMemoryTag::U32)), Field(&Row::avm_mem_tag, static_cast(AvmMemoryTag::U32)))); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } TEST_F(AvmMemOpcodeTests, indirectSetWrongTag) @@ -610,7 +610,7 @@ TEST_F(AvmMemOpcodeTests, indirectSetWrongTag) Field(&Row::avm_mem_tag, static_cast(AvmMemoryTag::U8)), Field(&Row::avm_mem_tag_err, 1))); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } /****************************************************************************** diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp index 926ce9bc2900..46c075557984 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp @@ -122,7 +122,7 @@ TEST_F(AvmMemoryTests, mismatchedTagEqOperation) EXPECT_EQ(row->avm_mem_r_in_tag, FF(static_cast(AvmMemoryTag::U32))); EXPECT_EQ(row->avm_mem_tag, FF(static_cast(AvmMemoryTag::U16))); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } // Testing violation that m_lastAccess is a delimiter for two different addresses