Skip to content

Commit

Permalink
enable multi-tx bytecode test
Browse files Browse the repository at this point in the history
  • Loading branch information
oclaw committed Dec 12, 2024
1 parent d8178a9 commit 44b08a8
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ namespace nil {
// if (make_links) {
// copy_constrain(input.rlc_challenge, rlc_challenge[0]);
// }
auto zerohash = zkevm_keccak_hash({});
static const auto zerohash = zkevm_keccak_hash({});
for(std::size_t i = 0; i < max_bytecode_size; i++) {
constrain(tag[i] * (tag[i] - 1)); // 0. TAG is zeroes or ones -- maybe there will be third value for non-used rows
constrain((tag[i] - 1) * index[i]); // 1. INDEX for HEADER and unused bytes is zero
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ 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;

const auto bytecode_trace_path = get_bytecode_trace_path(trace_base_path);
const auto contract_bytecodes = deserialize_bytecodes_from_file(bytecode_trace_path);
if (!contract_bytecodes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace nil {
const std::size_t max_bytecode_size = 20000;
const std::size_t max_rows = 500000;
const std::size_t max_mpt_size = 30;
const std::size_t max_zkevm_rows = 10000;
const std::size_t max_zkevm_rows = 50000;

const std::size_t RLC_CHALLENGE = 7; // should be the same between all components

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ INSTANTIATE_TEST_SUITE_P(SimpleCopy, ProverTests, ::testing::Values(Input{Simple
INSTANTIATE_TEST_SUITE_P(SimpleZkevm, ProverTests, ::testing::Values(Input{SimpleIncrement, ZKEVM, true})); // TODO

// Multiple calls of Counter contract increment function (several transactions)
// !! note that due to https://github.com/NilFoundation/placeholder/issues/196
// contracts for these traces were compiled with --no-cbor-metadata flag
const std::string MultiTxIncrement = "increment_multi_tx.pb";
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(MultiTxBytecode, ProverTests, ::testing::Values(Input{MultiTxIncrement, BYTECODE}));
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 44b08a8

Please sign in to comment.