Skip to content

Commit

Permalink
enable proof-producer multi-tx rw test
Browse files Browse the repository at this point in the history
  • Loading branch information
oclaw committed Dec 11, 2024
1 parent aa36930 commit 7423616
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,20 @@ namespace nil {

// Convert memory operations
for (const auto& pb_mop : pb_traces->memory_ops()) {
auto const value = string_to_bytes(pb_mop.value());
auto 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_bytes(value)
);
rw_traces.push_back(op);
rw_traces.push_back(std::move(op));
}

// Convert storage operations
for (const auto& pb_sop : pb_traces->storage_ops()) {
const auto& op = blueprint::bbf::storage_rw_operation(
auto op = blueprint::bbf::storage_rw_operation(
static_cast<uint64_t>(pb_sop.msg_id()),
blueprint::zkevm_word_from_string(static_cast<std::string>(pb_sop.key())),
static_cast<uint64_t>(pb_sop.rw_idx()),
Expand All @@ -192,17 +192,13 @@ namespace nil {
rw_traces.push_back(std::move(op));
}

using nil::blueprint::bbf::rw_operation;
std::sort(rw_traces.begin(), rw_traces.end(), [](rw_operation a, rw_operation b){
return a < b;
});
std::sort(rw_traces.begin(), rw_traces.end(), std::less());

BOOST_LOG_TRIVIAL(debug) << "number RW operations " << rw_traces.size() << ":\n"
<< "stack " << pb_traces->stack_ops_size() << "\n"
<< "memory " << pb_traces->memory_ops_size() << "\n"
<< "storage " << pb_traces->storage_ops_size() << "\n";


return rw_traces;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <nil/blueprint/utils/satisfiability_check.hpp>
#include <nil/proof-generator/prover.hpp>
#include "nil/proof-generator/preset/preset.hpp"
#include <nil/proof-generator/preset/preset.hpp>


namespace {
Expand All @@ -15,7 +15,7 @@ namespace {
bool skip_check{false}; // skip satisfiability check while running the test
};

}
} // namespace


class ProverTests: public ::testing::TestWithParam<Input> {
Expand Down Expand Up @@ -70,7 +70,7 @@ INSTANTIATE_TEST_SUITE_P(SimpleZkevm, ProverTests, ::testing::Values(Input{Simpl

// Multiple calls of Counter contract increment function (several transactions)
const std::string MultiTxIncrement = "increment_multi_tx.pb";
INSTANTIATE_TEST_SUITE_P(MultiTxRw, ProverTests, ::testing::Values(Input{MultiTxIncrement, RW, true})); // https://github.com/NilFoundation/placeholder/issues/187
INSTANTIATE_TEST_SUITE_P(MultiTxRw, ProverTests, ::testing::Values(Input{MultiTxIncrement, RW}));
INSTANTIATE_TEST_SUITE_P(MultiTxBytecode, ProverTests, ::testing::Values(Input{MultiTxIncrement, BYTECODE, true})); // TODO
INSTANTIATE_TEST_SUITE_P(MultiTxCopy, ProverTests, ::testing::Values(Input{MultiTxIncrement, COPY}));
INSTANTIATE_TEST_SUITE_P(MultiTxZkevm, ProverTests, ::testing::Values(Input{MultiTxIncrement, ZKEVM, true})); // TODO

0 comments on commit 7423616

Please sign in to comment.