Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Opcodes l2gasleft and dagasleft return value with tag ff #6896

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -2046,8 +2046,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 @@ -2064,7 +2069,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
Loading