aztec-packages icon indicating copy to clipboard operation
aztec-packages copied to clipboard

Support SET opcode with tag Field (keeping constant size bounded to 2**128 - 1)

Open sirasistant opened this issue 6 months ago • 0 comments

Currently, we bound the SET opcode constant size to 2.pow(128) - 1 in the AVM bytecode wire format, to keep opcodes within the size of one field. This issue is not about the constant size! The SET opcode has another limitation, that is that it can only set tags up to U128. There are some cases where the brillig codegen requires a SET with a small constant (<2.pow(128)) but with type field. In this case, the transpiler swaps the tag to U128 and adds an extra cast to field. If the AVM supports a SET with tag Field we'd avoid generating and running these extra cast opcodes.

sirasistant avatar Aug 19 '24 13:08 sirasistant