-
Notifications
You must be signed in to change notification settings - Fork 44
1970 mxp redesign #1988
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
base: arith-dev
Are you sure you want to change the base?
1970 mxp redesign #1988
Conversation
9e73108
to
b14cc55
Compare
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'd suggest to have, for each Mxp instruction, a instMxpCall tht extends an abstract MxpCall where you compute only the needed stuff (see what has been done for OOB).
...tization/src/main/java/net/consensys/linea/zktracer/module/blockdata/BlockdataOperation.java
Outdated
Show resolved
Hide resolved
arithmetization/src/main/java/net/consensys/linea/zktracer/module/euc/EucCall.java
Outdated
Show resolved
Hide resolved
arithmetization/src/main/java/net/consensys/linea/zktracer/module/euc/EucCall.java
Outdated
Show resolved
Hide resolved
arithmetization/src/main/java/net/consensys/linea/zktracer/module/mxpv3/MxpComputation.java
Outdated
Show resolved
Hide resolved
arithmetization/src/main/java/net/consensys/linea/zktracer/module/mxpv3/MxpComputation.java
Outdated
Show resolved
Hide resolved
arithmetization/src/main/java/net/consensys/linea/zktracer/module/mxpv3/MxpOperationV3.java
Outdated
Show resolved
Hide resolved
arithmetization/src/main/java/net/consensys/linea/zktracer/module/mxpv3/MxpOperationV3.java
Outdated
Show resolved
Hide resolved
arithmetization/src/main/java/net/consensys/linea/zktracer/module/mxpv3/MxpOperationV3.java
Outdated
Show resolved
Hide resolved
|| opCode.isCall(); | ||
} | ||
|
||
// This is a copy and past from FrontierGasCalculator.java |
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.
don't we already have this somewhere where we compute the exceptions ?
arithmetization/src/main/java/net/consensys/linea/zktracer/module/mxpv3/MxpV3.java
Outdated
Show resolved
Hide resolved
@@ -52,7 +52,7 @@ public void memoryExpansionExceptionTest(boolean triggerRoob, OpCode opCode) { | |||
MEMORY_EXPANSION_EXCEPTION, | |||
bytecodeRunner.getHub().previousTraceSection().commonValues.tracedException()); | |||
assertTrue(bytecodeRunner.getHub().mxp().operations().getLast().getMxpCall().isMxpx()); | |||
assertEquals(triggerRoob, bytecodeRunner.getHub().mxp().operations().getLast().isRoob()); | |||
// assertEquals(triggerRoob, bytecodeRunner.getHub().mxp().operations().getLast().isRoob()); |
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.
@lorenzogentile404 not sure why we comment this part ? Should we keep it while we run London version of Mxp ?
Okay so to keep the computation in the |
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 looked at the logic, not at the implementation
arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Hub.java
Outdated
Show resolved
Hide resolved
arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/imc/MxpCall.java
Outdated
Show resolved
Hide resolved
arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/imc/MxpCall.java
Outdated
Show resolved
Hide resolved
arithmetization/src/main/java/net/consensys/linea/zktracer/module/mxp/MxpExoCall.java
Outdated
Show resolved
Hide resolved
arithmetization/src/main/java/net/consensys/linea/zktracer/module/mxp/MxpExoCall.java
Outdated
Show resolved
Hide resolved
...rc/main/java/net/consensys/linea/zktracer/module/mxp/moduleOperation/CancunMxpOperation.java
Show resolved
Hide resolved
...rc/main/java/net/consensys/linea/zktracer/module/mxp/moduleOperation/CancunMxpOperation.java
Outdated
Show resolved
Hide resolved
.pComputationArg2Hi(scenario.exoCalls.get(i).arg2Hi()) | ||
.pComputationArg2Lo(scenario.exoCalls.get(i).arg2Lo()) | ||
.pComputationResA(scenario.exoCalls.get(i).resultA().toLong()) | ||
.pComputationResB(scenario.exoCalls.get(i).resultB().toLong()) |
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.
You might have sign issues :) we have conversion Bytes to unsignedLong somewhere
Redesign of the Mxp module for Cancun where MCOPY is added
The Mxp operation can follow 5 scenarii depending on the opcode. Each scenario executes wcp and euc computations and inherits from the previous scenario as computations are cumulative
1. MSize scenario
2. Trivial scenario
3. Mxpx scenario
4. State update with word pricing scenario
5. State update with byte pricing scenario