-
Notifications
You must be signed in to change notification settings - Fork 22
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
reconnect MMIO constraints #1388
base: arith-dev
Are you sure you want to change the base?
reconnect MMIO constraints #1388
Conversation
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
…n trivil inst Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
...tization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/imc/mmu/MmuCall.java
Show resolved
Hide resolved
...tization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/imc/mmu/MmuCall.java
Show resolved
Hide resolved
.../src/main/java/net/consensys/linea/zktracer/module/hub/fragment/imc/mmu/opcode/CodeCopy.java
Show resolved
Hide resolved
.../consensys/linea/zktracer/module/hub/section/call/precompileSubsection/ModexpSubsection.java
Show resolved
Hide resolved
...tion/src/main/java/net/consensys/linea/zktracer/module/hub/section/copy/CodeCopySection.java
Show resolved
Hide resolved
arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmio/Mmio.java
Show resolved
Hide resolved
arithmetization/src/main/java/net/consensys/linea/zktracer/module/mmu/Mmu.java
Show resolved
Hide resolved
final int sizeToExtract = mmioInst.size() == 0 ? LLARGE : mmioInst.size(); | ||
final Bytes16 exoLimb = readBytes(mmuData.exoBytes(), offset, sizeToExtract); | ||
mmioInst.limb(exoLimb); | ||
for (MmuToMmioInstruction mmioInst : mmuData.mmuToMmioInstructions()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the exoBytes is the source, We were extracting the (exo)limb from the SBO which is totally wrong. The exo limb is 16 bytes starting at 16 * SLO? And from this exo limb, we extract from SBO to extract the data. But We weren't reading the right exo(limb) as we were taking 16 bytes from 16*SLO + SBO for the exo bytes
@@ -263,7 +263,9 @@ public MmuData setMicroInstructions(MmuData mmuData) { | |||
middleMicroInstruction(mmuData, sourceLimbOffset, targetLimbOffset); | |||
} | |||
|
|||
lastMicroInstruction(mmuData); | |||
if (initialTotalNonTrivial > 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the nb of non trivial mmio inst is 1, we just have a only
mmio inst. We have a last
mmio inst only if we have 2 or more non trivial inst. Before the fix, when we had only one non trivial mmio inst, we were writting one only
mmio inst and then one last
mmio inst.
import org.apache.tuweni.bytes.Bytes; | ||
|
||
public class Bytecodes { | ||
|
||
public static Bytes16 readBytes(final Bytes data, final long offset, final int sizeToRead) { | ||
if (offset >= data.size()) { | ||
public static Bytes16 readBytes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we weren't doing the left padding before (this comes from the veridise audit, where we didn't use the SBO for one of the mmio inst). I made a mistake last time when I implemented it (and didn't see it because the MMIO constraint weren't plugged)
linea-constraints
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just update to the latest master. MMIO constraints are still not plugged
...tization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/imc/mmu/MmuCall.java
Show resolved
Hide resolved
...tization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/imc/mmu/MmuCall.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have to understand the changes labeled with ⭐, could you please give a short description of the intended effect ?
...tization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/imc/mmu/MmuCall.java
Show resolved
Hide resolved
.../src/main/java/net/consensys/linea/zktracer/module/hub/fragment/imc/mmu/opcode/CodeCopy.java
Show resolved
Hide resolved
import org.apache.tuweni.bytes.Bytes; | ||
|
||
public class Bytecodes { | ||
|
||
public static Bytes16 readBytes(final Bytes data, final long offset, final int sizeToRead) { | ||
if (offset >= data.size()) { | ||
public static Bytes16 readBytes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
@@ -263,7 +263,9 @@ public MmuData setMicroInstructions(MmuData mmuData) { | |||
middleMicroInstruction(mmuData, sourceLimbOffset, targetLimbOffset); | |||
} | |||
|
|||
lastMicroInstruction(mmuData); | |||
if (initialTotalNonTrivial > 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
final int sizeToExtract = mmioInst.size() == 0 ? LLARGE : mmioInst.size(); | ||
final Bytes16 exoLimb = readBytes(mmuData.exoBytes(), offset, sizeToExtract); | ||
mmioInst.limb(exoLimb); | ||
for (MmuToMmioInstruction mmioInst : mmuData.mmuToMmioInstructions()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
Signed-off-by: Francois Bojarski <francois.bojarski@consensys.net>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Signed-off-by: F Bojarski <ceciestunepoubelle@protonmail.ch>
Partial debugging of reconnecting the MMIO constraints (inner + all lookup touching the MMIO)