Skip to content

Commit

Permalink
Fix FullTracer::onOpcode with no_counters
Browse files Browse the repository at this point in the history
  • Loading branch information
fractasy committed Aug 22, 2024
1 parent 1f74381 commit 6e86eb3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 27 deletions.
19 changes: 10 additions & 9 deletions src/main_sm/fork_10/main/full_tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1494,15 +1494,6 @@ zkresult FullTracer::onOpcode(Context &ctx, const RomCommand &cmd)

Opcode singleInfo;

if (ctx.proverRequest.input.bNoCounters)
{
full_trace.emplace_back(singleInfo);
#ifdef LOG_TIME_STATISTICS
tms.add("onOpcode", TimeDiff(t));
#endif
return ZKR_SUCCESS;
}

mpz_class auxScalar;

#ifdef LOG_TIME_STATISTICS
Expand Down Expand Up @@ -1530,6 +1521,16 @@ zkresult FullTracer::onOpcode(Context &ctx, const RomCommand &cmd)
#ifdef LOG_TIME_STATISTICS
tmsop.add("getCodeID", TimeDiff(top));
#endif

if (ctx.proverRequest.input.bNoCounters && (codeId != 0xa0 /* LOG0 */))
{
full_trace.emplace_back(singleInfo);
#ifdef LOG_TIME_STATISTICS
tms.add("onOpcode", TimeDiff(t));
#endif
return ZKR_SUCCESS;
}

#ifdef LOG_TIME_STATISTICS
gettimeofday(&top, NULL);
#endif
Expand Down
19 changes: 10 additions & 9 deletions src/main_sm/fork_12/main/full_tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1494,15 +1494,6 @@ zkresult FullTracer::onOpcode(Context &ctx, const RomCommand &cmd)

Opcode singleInfo;

if (ctx.proverRequest.input.bNoCounters)
{
full_trace.emplace_back(singleInfo);
#ifdef LOG_TIME_STATISTICS
tms.add("onOpcode", TimeDiff(t));
#endif
return ZKR_SUCCESS;
}

mpz_class auxScalar;

#ifdef LOG_TIME_STATISTICS
Expand Down Expand Up @@ -1530,6 +1521,16 @@ zkresult FullTracer::onOpcode(Context &ctx, const RomCommand &cmd)
#ifdef LOG_TIME_STATISTICS
tmsop.add("getCodeID", TimeDiff(top));
#endif

if (ctx.proverRequest.input.bNoCounters && (codeId != 0xa0 /* LOG0 */))
{
full_trace.emplace_back(singleInfo);
#ifdef LOG_TIME_STATISTICS
tms.add("onOpcode", TimeDiff(t));
#endif
return ZKR_SUCCESS;
}

#ifdef LOG_TIME_STATISTICS
gettimeofday(&top, NULL);
#endif
Expand Down
19 changes: 10 additions & 9 deletions src/main_sm/fork_9/main/full_tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1498,15 +1498,6 @@ zkresult FullTracer::onOpcode(Context &ctx, const RomCommand &cmd)

Opcode singleInfo;

if (ctx.proverRequest.input.bNoCounters)
{
full_trace.emplace_back(singleInfo);
#ifdef LOG_TIME_STATISTICS
tms.add("onOpcode", TimeDiff(t));
#endif
return ZKR_SUCCESS;
}

mpz_class auxScalar;

#ifdef LOG_TIME_STATISTICS
Expand Down Expand Up @@ -1534,6 +1525,16 @@ zkresult FullTracer::onOpcode(Context &ctx, const RomCommand &cmd)
#ifdef LOG_TIME_STATISTICS
tmsop.add("getCodeID", TimeDiff(top));
#endif

if (ctx.proverRequest.input.bNoCounters && (codeId != 0xa0 /* LOG0 */))
{
full_trace.emplace_back(singleInfo);
#ifdef LOG_TIME_STATISTICS
tms.add("onOpcode", TimeDiff(t));
#endif
return ZKR_SUCCESS;
}

#ifdef LOG_TIME_STATISTICS
gettimeofday(&top, NULL);
#endif
Expand Down

0 comments on commit 6e86eb3

Please sign in to comment.