Skip to content

Commit

Permalink
init RLC challenge for copy circuit
Browse files Browse the repository at this point in the history
  • Loading branch information
oclaw committed Dec 6, 2024
1 parent 33ee1b3 commit bdde215
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crypto3/libs/blueprint/include/nil/blueprint/zkevm_bbf/copy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ namespace nil {

struct input_type{
TYPE rlc_challenge;
typename std::conditional<stage == GenerationStage::ASSIGNMENT, zkevm_keccak_buffers, std::nullptr_t>::type bytecodes;
typename std::conditional<stage == GenerationStage::ASSIGNMENT, zkevm_keccak_buffers, std::nullptr_t>::type keccak_buffers;
typename std::conditional<stage==GenerationStage::ASSIGNMENT, rw_operations_vector, std::nullptr_t>::type rw_operations;
typename std::conditional<stage==GenerationStage::ASSIGNMENT, std::vector<copy_event>, std::nullptr_t>::type copy_events;

template<typename T>
using enable_for_assignment_t = typename std::conditional_t<stage == GenerationStage::ASSIGNMENT, T, std::nullptr_t>;

enable_for_assignment_t<zkevm_keccak_buffers> bytecodes;
enable_for_assignment_t<zkevm_keccak_buffers> keccak_buffers;
enable_for_assignment_t<rw_operations_vector> rw_operations;
enable_for_assignment_t<std::vector<copy_event>> copy_events;
};
public:
using BytecodeTable = bytecode_table<FieldType, stage>;
Expand Down
4 changes: 4 additions & 0 deletions proof-producer/libs/assigner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
find_package(Protobuf REQUIRED)
find_package(absl REQUIRED)


file(GLOB PROTO_FILES "proto/*.proto")

Expand Down Expand Up @@ -42,6 +44,8 @@ target_link_libraries(proof_generatorAssigner
crypto3::common
Boost::filesystem
Boost::log
absl::strings
absl::log_internal_check_op
${PROTOBUF_LIBRARY}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace nil {
typename nil::blueprint::bbf::context<BlueprintFieldType, nil::blueprint::bbf::GenerationStage::ASSIGNMENT> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ namespace nil {

nil::blueprint::circuit<crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType>> circuit;
typename ComponentType::input_type input;
input.rlc_challenge = limits::RLC_CHALLENGE;

blueprint::components::generate_circuit(
wrapper,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <cstdint>
#include "nil/proof-generator/preset/preset.hpp"

namespace nil {
namespace proof_generator {
Expand All @@ -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

0 comments on commit bdde215

Please sign in to comment.