Skip to content

Commit

Permalink
chore: Opcodes l2gasleft and dagasleft return value with tag ff (#6896)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmon authored Jun 5, 2024
1 parent 5fe59d2 commit 5890845
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2048,8 +2048,13 @@ void AvmTraceBuilder::execute_gasleft(OpCode opcode, uint8_t indirect, uint32_t
}

// Write into memory from intermediate register ia.
mem_trace_builder.write_into_memory(
call_ptr, clk, IntermRegister::IA, direct_dst_offset, gas_remaining, AvmMemoryTag::U0, AvmMemoryTag::U32);
mem_trace_builder.write_into_memory(call_ptr,
clk,
IntermRegister::IA,
direct_dst_offset,
gas_remaining,
AvmMemoryTag::U0,
AvmMemoryTag::FF); // TODO: probably will be U32 in final version

main_trace.push_back(Row{
.avm_main_clk = clk,
Expand All @@ -2066,7 +2071,8 @@ void AvmTraceBuilder::execute_gasleft(OpCode opcode, uint8_t indirect, uint32_t
.avm_main_sel_op_dagasleft = (opcode == OpCode::DAGASLEFT) ? FF(1) : FF(0),
.avm_main_sel_op_l2gasleft = (opcode == OpCode::L2GASLEFT) ? FF(1) : FF(0),
.avm_main_tag_err = FF(static_cast<uint32_t>(!tag_match)),
.avm_main_w_in_tag = FF(static_cast<uint32_t>(AvmMemoryTag::U32)),
.avm_main_w_in_tag = FF(static_cast<uint32_t>(AvmMemoryTag::FF)), // TODO: probably will be U32 in final version
// Should the circuit (pil) constrain U32?
});
}

Expand Down

0 comments on commit 5890845

Please sign in to comment.