diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmio/MmioPatterns.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmio/MmioPatterns.java index d7798d4944..4939d588cb 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmio/MmioPatterns.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmio/MmioPatterns.java @@ -182,17 +182,6 @@ public static Bytes16 excision( public static void updateTemporaryTargetRam( MmuData mmuData, final long targetLimbOffsetToUpdate, final Bytes16 newLimb) { - final Bytes bytesPreLimb = - Bytes.repeat( - (byte) 0, - (int) - (LLARGE - * targetLimbOffsetToUpdate)); // We won't access the preLimb again, so we don't - // care - // of its value - final Bytes bytesPostLimb = - mmuData.targetRamBytes().slice((int) ((targetLimbOffsetToUpdate + 1) * LLARGE)); - - mmuData.targetRamBytes(Bytes.concatenate(bytesPreLimb, newLimb, bytesPostLimb)); + mmuData.targetRamBytes().set((int) targetLimbOffsetToUpdate, newLimb); } } diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmu/MmuData.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmu/MmuData.java index 87e10554b2..0a0261fdda 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmu/MmuData.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmu/MmuData.java @@ -37,6 +37,7 @@ import net.consensys.linea.zktracer.module.mmu.values.MmuToMmioInstruction; import net.consensys.linea.zktracer.module.mmu.values.MmuWcpCallRecord; import org.apache.tuweni.bytes.Bytes; +import org.apache.tuweni.bytes.MutableBytes; @AllArgsConstructor @Getter @@ -56,7 +57,7 @@ public class MmuData { private boolean mmuInstAnyToRamWithPaddingIsPurePadding; private Bytes exoBytes; private Bytes sourceRamBytes; - private Bytes targetRamBytes; + private MutableBytes targetRamBytes; private final boolean exoLimbIsSource; private final boolean exoLimbIsTarget; private static final List MMU_INST_EXO_IS_SOURCE = @@ -83,7 +84,7 @@ public MmuData(final MmuCall mmuCall) { false, Bytes.EMPTY, Bytes.EMPTY, - Bytes.EMPTY, + MutableBytes.EMPTY, MMU_INST_EXO_IS_SOURCE.contains(mmuCall.instruction()), MMU_INST_EXO_IS_TARGET.contains(mmuCall.instruction())); @@ -112,7 +113,7 @@ public void setSourceRamBytes() { public void setTargetRamBytes() { if (mmuCall.targetRamBytes().isPresent()) { - targetRamBytes(mmuCall.targetRamBytes().get()); + targetRamBytes(mmuCall.targetRamBytes().get().mutableCopy()); } } diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmu/instructions/ExoToRamTransplants.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmu/instructions/ExoToRamTransplants.java index 53ee520567..afa133717f 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmu/instructions/ExoToRamTransplants.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmu/instructions/ExoToRamTransplants.java @@ -32,6 +32,7 @@ import net.consensys.linea.zktracer.module.mmu.values.MmuToMmioInstruction; import net.consensys.linea.zktracer.module.mmu.values.MmuWcpCallRecord; import org.apache.tuweni.bytes.Bytes; +import org.apache.tuweni.bytes.MutableBytes; public class ExoToRamTransplants implements MmuInstruction { private final Euc euc; @@ -89,7 +90,7 @@ public MmuData setMicroInstructions(MmuData mmuData) { // Setting the target ram bytes // The target CN is ALWAYS a new, virgin, fictitious context, where is either write the call // data, or the result of a precompile - mmuData.targetRamBytes(Bytes.EMPTY); + mmuData.targetRamBytes(MutableBytes.EMPTY); // setting the MMIO instructions for (int i = 0; i < mmuData.totalNonTrivialInitials(); i++) { diff --git a/linea-constraints b/linea-constraints index f0ce0da1e1..1c658b55bc 160000 --- a/linea-constraints +++ b/linea-constraints @@ -1 +1 @@ -Subproject commit f0ce0da1e102ecff0ed1d83e6ece0e2874cc07ad +Subproject commit 1c658b55bcde39395b636f1ff70cb93aaee2d06b