Skip to content

Commit

Permalink
fix rw trace deserialize
Browse files Browse the repository at this point in the history
  • Loading branch information
oclaw committed Dec 4, 2024
1 parent b6424a1 commit e85c732
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ namespace nil {
<< "\tCopy event " << copy_op_to_num(cp.source_type)
<< " => " << copy_op_to_num(cp.destination_type)
<< " bytes size " << cp.bytes.size()
<< " rw_counter " << cp.initial_rw_counter
<< std::endl;
assert(cp.bytes.size() > 0);
for( std::size_t i = 0; i < cp.bytes.size(); i++ ){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ namespace nil {
}
TYPE RLC_value = calculateRLC<FieldType>(msg, theta);
for( std::size_t block = 0; block < std::ceil(float(msg.size() + 1)/136); block++){
assert(block_counter < max_blocks);
if( block != std::ceil(float(msg.size() + 1)/136) - 1){
is_last[block_counter] = 0;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace nil {
return input.size() - 1;
}

std::size_t new_buffer(const std::vector<std::uint8_t> buffer){
std::size_t new_buffer(const std::vector<std::uint8_t>& buffer){
input.push_back({buffer, zkevm_keccak_hash(buffer)});
return input.size() - 1;
}
Expand Down
6 changes: 4 additions & 2 deletions proof-producer/libs/assigner/src/trace_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,15 @@ namespace nil {
// Convert memory operations
rw_traces.memory_ops.reserve(pb_traces->memory_ops_size());
for (const auto& pb_mop : pb_traces->memory_ops()) {
rw_traces.memory_ops.push_back(blueprint::bbf::memory_rw_operation(
auto const value = string_to_bytes(pb_mop.value());
auto const op = blueprint::bbf::memory_rw_operation(
static_cast<uint64_t>(pb_mop.msg_id()),
blueprint::zkevm_word_type(static_cast<int>(pb_mop.index())),
static_cast<uint64_t>(pb_mop.rw_idx()),
!pb_mop.is_read(),
blueprint::zkevm_word_from_string(static_cast<std::string>(pb_mop.value())))
blueprint::zkevm_word_from_bytes(value)
);
rw_traces.memory_ops.push_back(op);
}

// Convert storage operations
Expand Down

0 comments on commit e85c732

Please sign in to comment.