Skip to content

Commit 887b41c

Browse files
committed
Addressing omitted feedback from PR #13038
1 parent 27f1eca commit 887b41c

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

barretenberg/cpp/src/barretenberg/vm/avm/trace/deserialization.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
namespace bb::avm_trace {
1010

11-
// Possible types for an instruction's operand in its wire format. (Keep in sync with TS code.
12-
// See avm/serialization/instruction_serialization.ts).
13-
// Note that the TAG enum value is not supported in TS and is parsed as UINT8.
11+
// Possible types for an instruction's operand in its wire format.
12+
// The counterpart TS file is: avm/serialization/instruction_serialization.ts.
1413
// INDIRECT is parsed as UINT8 where the bits represent the operands that have indirect mem access.
1514
enum class OperandType : uint8_t { INDIRECT8, INDIRECT16, TAG, UINT8, UINT16, UINT32, UINT64, UINT128, FF };
1615

barretenberg/cpp/src/barretenberg/vm2/simulation/lib/serialization.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace bb::avm2::simulation {
1414

1515
// Possible types for an instruction's operand in its wire format.
16-
// Note that the TAG enum value is not supported in TS and is parsed as UINT8.
16+
// The counterpart TS file is: avm/serialization/instruction_serialization.ts.
1717
// INDIRECT is parsed as UINT8 where the bits represent the operands that have indirect mem access.
1818
enum class OperandType : uint8_t { INDIRECT8, INDIRECT16, TAG, UINT8, UINT16, UINT32, UINT64, UINT128, FF };
1919

yarn-project/simulator/src/public/avm/serialization/instruction_serialization.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,8 @@ export const MAX_OPCODE_VALUE = Math.max(
9393
.filter(k => !isNaN(k)),
9494
);
9595

96-
// Possible types for an instruction's operand in its wire format. (Keep in sync with CPP code.
97-
// See vm/avm_trace/deserialization.cpp)
98-
// Note that cpp code introduced an additional enum value TAG to express the instruction tag. In TS,
99-
// this one is parsed as UINT8.
96+
// Possible types for an instruction's operand in its wire format.
97+
// The counterpart cpp file is: vm2/simulation/lib/serialization.hpp.
10098
export enum OperandType {
10199
UINT8,
102100
UINT16,
@@ -186,7 +184,7 @@ export function deserialize(cursor: BufferCursor | Buffer, operands: OperandType
186184
if (operands[i] === OperandType.TAG) {
187185
// We parsed a single byte (readUInt8()) and therefore value is of number type (not bigint)
188186
// We need to cast to number because checkIsValidTag expects a number.
189-
TaggedMemory.checkIsValidTag(Number(argValues[i]) ?? 0);
187+
TaggedMemory.checkIsValidTag(Number(argValues[i] ?? 0));
190188
}
191189
}
192190

0 commit comments

Comments
 (0)