From d028db6f0ead0e655ea58438491729a619d7aebc Mon Sep 17 00:00:00 2001 From: jeanmon Date: Thu, 25 Jan 2024 14:20:26 +0000 Subject: [PATCH] 3791: rename call_data_copy to calldata_copy --- .../vm/avm_trace/AvmMini_execution.cpp | 2 +- .../vm/avm_trace/AvmMini_trace.cpp | 8 +++--- .../vm/avm_trace/AvmMini_trace.hpp | 8 +++--- .../vm/tests/AvmMini_arithmetic.test.cpp | 28 +++++++++---------- .../vm/tests/AvmMini_memory.test.cpp | 12 ++++---- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_execution.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_execution.cpp index 52b3867b6630..47e6001b82c1 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_execution.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_execution.cpp @@ -174,7 +174,7 @@ std::vector Execution::gen_trace(std::vector const& instructio trace_builder.div(inst.operands.at(0), inst.operands.at(1), inst.operands.at(2), inst.in_tag); break; case OpCode::CALLDATACOPY: - trace_builder.call_data_copy(inst.operands.at(0), inst.operands.at(1), inst.operands.at(2), calldata); + trace_builder.calldata_copy(inst.operands.at(0), inst.operands.at(1), inst.operands.at(2), calldata); break; case OpCode::JUMP: trace_builder.jump(inst.operands.at(0)); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_trace.cpp index bd72d96afdd2..08952de4e1b0 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_trace.cpp @@ -279,10 +279,10 @@ void AvmMiniTraceBuilder::set(uint128_t val, uint32_t dst_offset, AvmMemoryTag i * @param dst_offset The starting index of memory where calldata will be copied to. * @param call_data_mem The vector containing calldata. */ -void AvmMiniTraceBuilder::call_data_copy(uint32_t cd_offset, - uint32_t copy_size, - uint32_t dst_offset, - std::vector const& call_data_mem) +void AvmMiniTraceBuilder::calldata_copy(uint32_t cd_offset, + uint32_t copy_size, + uint32_t dst_offset, + std::vector const& call_data_mem) { // We parallelize storing memory operations in chunk of 3, i.e., 1 per intermediate register. // The variable pos is an index pointing to the first storing operation (pertaining to intermediate diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_trace.hpp index e9e7b35dd1f3..0d58753111eb 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/AvmMini_trace.hpp @@ -56,10 +56,10 @@ class AvmMiniTraceBuilder { // CALLDATACOPY opcode with direct memory access, i.e., // M[dst_offset:dst_offset+copy_size] = calldata[cd_offset:cd_offset+copy_size] - void call_data_copy(uint32_t cd_offset, - uint32_t copy_size, - uint32_t dst_offset, - std::vector const& call_data_mem); + void calldata_copy(uint32_t cd_offset, + uint32_t copy_size, + uint32_t dst_offset, + std::vector const& call_data_mem); // RETURN opcode with direct memory access, i.e., // return(M[ret_offset:ret_offset+ret_size]) diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/AvmMini_arithmetic.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/AvmMini_arithmetic.test.cpp index cc2bb3e908ec..6cde3d101861 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/AvmMini_arithmetic.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/AvmMini_arithmetic.test.cpp @@ -246,7 +246,7 @@ class AvmMiniArithmeticNegativeTestsU128 : public AvmMiniArithmeticTests {}; TEST_F(AvmMiniArithmeticTestsFF, addition) { // trace_builder - trace_builder.call_data_copy(0, 3, 0, std::vector{ 37, 4, 11 }); + trace_builder.calldata_copy(0, 3, 0, std::vector{ 37, 4, 11 }); // Memory layout: [37,4,11,0,0,0,....] trace_builder.add(0, 1, 4, AvmMemoryTag::FF); // [37,4,11,0,41,0,....] @@ -265,7 +265,7 @@ TEST_F(AvmMiniArithmeticTestsFF, addition) // Test on basic subtraction over finite field type. TEST_F(AvmMiniArithmeticTestsFF, subtraction) { - trace_builder.call_data_copy(0, 3, 0, std::vector{ 8, 4, 17 }); + trace_builder.calldata_copy(0, 3, 0, std::vector{ 8, 4, 17 }); // Memory layout: [8,4,17,0,0,0,....] trace_builder.sub(2, 0, 1, AvmMemoryTag::FF); // [8,9,17,0,0,0....] @@ -284,7 +284,7 @@ TEST_F(AvmMiniArithmeticTestsFF, subtraction) // Test on basic multiplication over finite field type. TEST_F(AvmMiniArithmeticTestsFF, multiplication) { - trace_builder.call_data_copy(0, 3, 0, std::vector{ 5, 0, 20 }); + trace_builder.calldata_copy(0, 3, 0, std::vector{ 5, 0, 20 }); // Memory layout: [5,0,20,0,0,0,....] trace_builder.mul(2, 0, 1, AvmMemoryTag::FF); // [5,100,20,0,0,0....] @@ -304,7 +304,7 @@ TEST_F(AvmMiniArithmeticTestsFF, multiplication) // Test on multiplication by zero over finite field type. TEST_F(AvmMiniArithmeticTestsFF, multiplicationByZero) { - trace_builder.call_data_copy(0, 1, 0, std::vector{ 127 }); + trace_builder.calldata_copy(0, 1, 0, std::vector{ 127 }); // Memory layout: [127,0,0,0,0,0,....] trace_builder.mul(0, 1, 2, AvmMemoryTag::FF); // [127,0,0,0,0,0....] @@ -324,7 +324,7 @@ TEST_F(AvmMiniArithmeticTestsFF, multiplicationByZero) // Test on basic division over finite field type. TEST_F(AvmMiniArithmeticTestsFF, division) { - trace_builder.call_data_copy(0, 2, 0, std::vector{ 15, 315 }); + trace_builder.calldata_copy(0, 2, 0, std::vector{ 15, 315 }); // Memory layout: [15,315,0,0,0,0,....] trace_builder.div(1, 0, 2, AvmMemoryTag::FF); // [15,315,21,0,0,0....] @@ -347,7 +347,7 @@ TEST_F(AvmMiniArithmeticTestsFF, division) // Test on division with zero numerator over finite field type. TEST_F(AvmMiniArithmeticTestsFF, divisionNumeratorZero) { - trace_builder.call_data_copy(0, 1, 0, std::vector{ 15 }); + trace_builder.calldata_copy(0, 1, 0, std::vector{ 15 }); // Memory layout: [15,0,0,0,0,0,....] trace_builder.div(1, 0, 0, AvmMemoryTag::FF); // [0,0,0,0,0,0....] @@ -371,7 +371,7 @@ TEST_F(AvmMiniArithmeticTestsFF, divisionNumeratorZero) // We check that the operator error flag is raised. TEST_F(AvmMiniArithmeticTestsFF, divisionByZeroError) { - trace_builder.call_data_copy(0, 1, 0, std::vector{ 15 }); + trace_builder.calldata_copy(0, 1, 0, std::vector{ 15 }); // Memory layout: [15,0,0,0,0,0,....] trace_builder.div(0, 1, 2, AvmMemoryTag::FF); // [15,0,0,0,0,0....] @@ -421,7 +421,7 @@ TEST_F(AvmMiniArithmeticTestsFF, divisionZeroByZeroError) // No check on the evaluation is performed here. TEST_F(AvmMiniArithmeticTestsFF, mixedOperationsWithError) { - trace_builder.call_data_copy(0, 3, 2, std::vector{ 45, 23, 12 }); + trace_builder.calldata_copy(0, 3, 2, std::vector{ 45, 23, 12 }); // Memory layout: [0,0,45,23,12,0,0,0,....] trace_builder.add(2, 3, 4, AvmMemoryTag::FF); // [0,0,45,23,68,0,0,0,....] @@ -1399,7 +1399,7 @@ TEST_F(AvmMiniArithmeticNegativeTestsFF, multiplication) // Test on basic incorrect division over finite field type. TEST_F(AvmMiniArithmeticNegativeTestsFF, divisionFF) { - trace_builder.call_data_copy(0, 2, 0, std::vector{ 15, 315 }); + trace_builder.calldata_copy(0, 2, 0, std::vector{ 15, 315 }); // Memory layout: [15,315,0,0,0,0,....] trace_builder.div(1, 0, 2, AvmMemoryTag::FF); // [15,315,21,0,0,0....] @@ -1416,7 +1416,7 @@ TEST_F(AvmMiniArithmeticNegativeTestsFF, divisionFF) // in the trace. TEST_F(AvmMiniArithmeticNegativeTestsFF, divisionNoZeroButError) { - trace_builder.call_data_copy(0, 2, 0, std::vector{ 15, 315 }); + trace_builder.calldata_copy(0, 2, 0, std::vector{ 15, 315 }); // Memory layout: [15,315,0,0,0,0,....] trace_builder.div(1, 0, 2, AvmMemoryTag::FF); // [15,315,21,0,0,0....] @@ -1442,7 +1442,7 @@ TEST_F(AvmMiniArithmeticNegativeTestsFF, divisionNoZeroButError) // Test with division by zero occurs and no error is raised (remove error flag) TEST_F(AvmMiniArithmeticNegativeTestsFF, divisionByZeroNoError) { - trace_builder.call_data_copy(0, 1, 0, std::vector{ 15 }); + trace_builder.calldata_copy(0, 1, 0, std::vector{ 15 }); // Memory layout: [15,0,0,0,0,0,....] trace_builder.div(0, 1, 2, AvmMemoryTag::FF); // [15,0,0,0,0,0....] @@ -1479,7 +1479,7 @@ TEST_F(AvmMiniArithmeticNegativeTestsFF, divisionZeroByZeroNoError) // the addition, subtraction, multiplication. TEST_F(AvmMiniArithmeticNegativeTestsFF, operationWithErrorFlag) { - trace_builder.call_data_copy(0, 3, 0, std::vector{ 37, 4, 11 }); + trace_builder.calldata_copy(0, 3, 0, std::vector{ 37, 4, 11 }); // Memory layout: [37,4,11,0,0,0,....] trace_builder.add(0, 1, 4, AvmMemoryTag::FF); // [37,4,11,0,41,0,....] @@ -1497,7 +1497,7 @@ TEST_F(AvmMiniArithmeticNegativeTestsFF, operationWithErrorFlag) trace_builder.reset(); - trace_builder.call_data_copy(0, 3, 0, std::vector{ 8, 4, 17 }); + trace_builder.calldata_copy(0, 3, 0, std::vector{ 8, 4, 17 }); // Memory layout: [8,4,17,0,0,0,....] trace_builder.sub(2, 0, 1, AvmMemoryTag::FF); // [8,9,17,0,0,0....] @@ -1514,7 +1514,7 @@ TEST_F(AvmMiniArithmeticNegativeTestsFF, operationWithErrorFlag) trace_builder.reset(); - trace_builder.call_data_copy(0, 3, 0, std::vector{ 5, 0, 20 }); + trace_builder.calldata_copy(0, 3, 0, std::vector{ 5, 0, 20 }); // Memory layout: [5,0,20,0,0,0,....] trace_builder.mul(2, 0, 1, AvmMemoryTag::FF); // [5,100,20,0,0,0....] diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/AvmMini_memory.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/AvmMini_memory.test.cpp index 79088fb0304a..f51e41395390 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/AvmMini_memory.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/AvmMini_memory.test.cpp @@ -32,7 +32,7 @@ class AvmMiniMemoryTests : public ::testing::Test { // The proof must pass and we check that the AVM error is raised. TEST_F(AvmMiniMemoryTests, mismatchedTag) { - trace_builder.call_data_copy(0, 2, 0, std::vector{ 98, 12 }); + trace_builder.calldata_copy(0, 2, 0, std::vector{ 98, 12 }); trace_builder.add(0, 1, 4, AvmMemoryTag::U8); trace_builder.halt(); @@ -79,7 +79,7 @@ TEST_F(AvmMiniMemoryTests, mismatchedTag) // in the memory trace TEST_F(AvmMiniMemoryTests, mLastAccessViolation) { - trace_builder.call_data_copy(0, 2, 0, std::vector{ 4, 9 }); + trace_builder.calldata_copy(0, 2, 0, std::vector{ 4, 9 }); // Memory layout: [4,9,0,0,0,0,....] trace_builder.sub(1, 0, 2, AvmMemoryTag::U8); // [4,9,5,0,0,0.....] @@ -109,7 +109,7 @@ TEST_F(AvmMiniMemoryTests, mLastAccessViolation) // written into memory TEST_F(AvmMiniMemoryTests, readWriteConsistencyValViolation) { - trace_builder.call_data_copy(0, 2, 0, std::vector{ 4, 9 }); + trace_builder.calldata_copy(0, 2, 0, std::vector{ 4, 9 }); // Memory layout: [4,9,0,0,0,0,....] trace_builder.mul(1, 0, 2, AvmMemoryTag::U8); // [4,9,36,0,0,0.....] @@ -139,7 +139,7 @@ TEST_F(AvmMiniMemoryTests, readWriteConsistencyValViolation) // written into memory TEST_F(AvmMiniMemoryTests, readWriteConsistencyTagViolation) { - trace_builder.call_data_copy(0, 2, 0, std::vector{ 4, 9 }); + trace_builder.calldata_copy(0, 2, 0, std::vector{ 4, 9 }); // Memory layout: [4,9,0,0,0,0,....] trace_builder.mul(1, 0, 2, AvmMemoryTag::U8); // [4,9,36,0,0,0.....] @@ -180,7 +180,7 @@ TEST_F(AvmMiniMemoryTests, readUninitializedMemoryViolation) // must raise a VM error. TEST_F(AvmMiniMemoryTests, mismatchedTagErrorViolation) { - trace_builder.call_data_copy(0, 2, 0, std::vector{ 98, 12 }); + trace_builder.calldata_copy(0, 2, 0, std::vector{ 98, 12 }); trace_builder.sub(0, 1, 4, AvmMemoryTag::U8); trace_builder.halt(); @@ -214,7 +214,7 @@ TEST_F(AvmMiniMemoryTests, mismatchedTagErrorViolation) // must not set a VM error. TEST_F(AvmMiniMemoryTests, consistentTagNoErrorViolation) { - trace_builder.call_data_copy(0, 2, 0, std::vector{ 84, 7 }); + trace_builder.calldata_copy(0, 2, 0, std::vector{ 84, 7 }); trace_builder.div(0, 1, 4, AvmMemoryTag::FF); trace_builder.halt();