From bdde215653dcf3bd964a2b3a94f2b9918aed03e3 Mon Sep 17 00:00:00 2001 From: Daniel Kogtev Date: Thu, 5 Dec 2024 18:47:59 +0000 Subject: [PATCH] init RLC challenge for copy circuit --- .../include/nil/blueprint/zkevm_bbf/copy.hpp | 12 ++++++++---- proof-producer/libs/assigner/CMakeLists.txt | 4 ++++ .../include/nil/proof-generator/assigner/copy.hpp | 1 + .../include/nil/proof-generator/preset/copy.hpp | 1 + .../include/nil/proof-generator/preset/limits.hpp | 3 +++ 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/crypto3/libs/blueprint/include/nil/blueprint/zkevm_bbf/copy.hpp b/crypto3/libs/blueprint/include/nil/blueprint/zkevm_bbf/copy.hpp index 41de9c7266..660f8df99a 100644 --- a/crypto3/libs/blueprint/include/nil/blueprint/zkevm_bbf/copy.hpp +++ b/crypto3/libs/blueprint/include/nil/blueprint/zkevm_bbf/copy.hpp @@ -45,10 +45,14 @@ namespace nil { struct input_type{ TYPE rlc_challenge; - typename std::conditional::type bytecodes; - typename std::conditional::type keccak_buffers; - typename std::conditional::type rw_operations; - typename std::conditional, std::nullptr_t>::type copy_events; + + template + using enable_for_assignment_t = typename std::conditional_t; + + enable_for_assignment_t bytecodes; + enable_for_assignment_t keccak_buffers; + enable_for_assignment_t rw_operations; + enable_for_assignment_t> copy_events; }; public: using BytecodeTable = bytecode_table; diff --git a/proof-producer/libs/assigner/CMakeLists.txt b/proof-producer/libs/assigner/CMakeLists.txt index 520dcdce74..2a2e51f75b 100644 --- a/proof-producer/libs/assigner/CMakeLists.txt +++ b/proof-producer/libs/assigner/CMakeLists.txt @@ -1,4 +1,6 @@ find_package(Protobuf REQUIRED) +find_package(absl REQUIRED) + file(GLOB PROTO_FILES "proto/*.proto") @@ -42,6 +44,8 @@ target_link_libraries(proof_generatorAssigner crypto3::common Boost::filesystem Boost::log + absl::strings + absl::log_internal_check_op ${PROTOBUF_LIBRARY} ) diff --git a/proof-producer/libs/assigner/include/nil/proof-generator/assigner/copy.hpp b/proof-producer/libs/assigner/include/nil/proof-generator/assigner/copy.hpp index cdc9ed525c..2d0acbcedb 100644 --- a/proof-producer/libs/assigner/include/nil/proof-generator/assigner/copy.hpp +++ b/proof-producer/libs/assigner/include/nil/proof-generator/assigner/copy.hpp @@ -27,6 +27,7 @@ namespace nil { typename nil::blueprint::bbf::context context_object(assignment_table, limits::max_rows); typename ComponentType::input_type input; + input.rlc_challenge = limits::RLC_CHALLENGE; auto copy_events = deserialize_copy_events_from_file(trace_file_path); if (!copy_events) { diff --git a/proof-producer/libs/preset/include/nil/proof-generator/preset/copy.hpp b/proof-producer/libs/preset/include/nil/proof-generator/preset/copy.hpp index 27e3125d4f..694b1c8a21 100644 --- a/proof-producer/libs/preset/include/nil/proof-generator/preset/copy.hpp +++ b/proof-producer/libs/preset/include/nil/proof-generator/preset/copy.hpp @@ -61,6 +61,7 @@ namespace nil { nil::blueprint::circuit> circuit; typename ComponentType::input_type input; + input.rlc_challenge = limits::RLC_CHALLENGE; blueprint::components::generate_circuit( wrapper, diff --git a/proof-producer/libs/preset/include/nil/proof-generator/preset/limits.hpp b/proof-producer/libs/preset/include/nil/proof-generator/preset/limits.hpp index fe6e7a92c8..6acee5eba9 100644 --- a/proof-producer/libs/preset/include/nil/proof-generator/preset/limits.hpp +++ b/proof-producer/libs/preset/include/nil/proof-generator/preset/limits.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include "nil/proof-generator/preset/preset.hpp" namespace nil { namespace proof_generator { @@ -14,6 +15,8 @@ namespace nil { const std::size_t max_mpt_size = 30; const std::size_t max_zkevm_rows = 10000; + const std::size_t RLC_CHALLENGE = 7; // should be the same between all components + } // limits } // proof_generator } // nil