-
Notifications
You must be signed in to change notification settings - Fork 46
EIP-7823 and EIP-7883 implementation --- Osaka MODEXP changes
#2477
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?
Conversation
...ensys/linea/zktracer/module/hub/section/call/precompileSubsection/OsakaModexpSubsection.java
Show resolved
Hide resolved
...ktracer/module/hub/fragment/imc/oob/precompiles/modexp/xbsOobCall/OsakaModexpXbsOobCall.java
Outdated
Show resolved
Hide resolved
...sensys/linea/zktracer/module/hub/section/call/precompileSubsection/PrecompileSubsection.java
Show resolved
Hide resolved
| public static MmuCall forModexpExtractMbs( | ||
| final Hub hub, final ModexpSubsection subsection, final ModexpMetadata metaData) { | ||
| public static MmuCall extractMbsForModexp( | ||
| final Hub hub, final LondonModexpSubsection subsection, final ModexpMetadata metaData) { |
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.
Is it normal ? What's happening for OsakaModexpSection ?
| } | ||
|
|
||
| public int getMaxInputSize() { | ||
| return 512; |
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 constant has a name somewhere ...
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.
It doesn't in the HUB constraints.
| @Override | ||
| public boolean isBlakeOperation() { | ||
| return false; | ||
| } |
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.
Bug: Hardcoded Logic Breaks Blake/Modexp Precompiles
The overridden methods isModexpOperation() and isBlakeOperation() in LondonBlakeModexpOperation both hardcode return false, breaking the logic inherited from the parent class. These methods should delegate to the parent implementation which correctly checks modexpMetaData.isPresent() and blake2fComponents.isPresent(). This causes checkState() assertions in BlakeModexp.callModexp() and BlakeModexp.callBlake() to fail when operations are added, preventing MODEXP and BLAKE2f precompile calls from working.
arithmetization/src/main/java/net/consensys/linea/zktracer/ZkCounter.java
Outdated
Show resolved
Hide resolved
One failing test (MODEXP limits)
the old tests were overwriting mbs in memory !
| public class OsakaModexpSubsection extends LondonModexpSubsection { | ||
| public OsakaModexpSubsection(Hub hub, CallSection callSection, ModexpMetadata modexpMetadata) { | ||
| super(hub, callSection, modexpMetadata); | ||
| checkState( |
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.
Bug: Misleading Error Message Type
The checkState error message says "modexpMetadata must be LondonModexpMetadata" but it should say "modexpMetadata must be OsakaModexpMetadata". This is a copy-paste error from the parent class that will cause confusion when debugging if the check fails, as it will report the wrong expected type.
| protected BlakeModexpOperation getForkAppropriateBlakeModexpOperation() { | ||
| return new LondonBlakeModexpOperation( | ||
| getForkAppropriateModexpMetadata(), exoModuleOperationId()); | ||
| } |
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.
Bug: Osaka BlakeModexp: Incorrect fork logic applied.
The getForkAppropriateBlakeModexpOperation method returns LondonBlakeModexpOperation instead of OsakaBlakeModexpOperation. This means Osaka MODEXP operations will use London's component byte size limits and index maximums instead of Osaka's potentially different values, causing incorrect trace generation for the blakemodexp module when processing Osaka MODEXP calls.
| } | ||
|
|
||
| @Override | ||
| public void callExoModulesAndSetOutputs(Add add, Mod mod, Wcp wcp) { |
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.
Bug: Osaka MODEXP: Core Pricing Logic Absent
The callExoModulesAndSetOutputs method in OsakaModexpPricingOobCall is not implemented (contains only a TODO comment). This means Osaka MODEXP pricing calculations will not be performed, causing the pricing OOB call to fail to set required output values like ramSuccess, returnGas, and returnAtCapacityNonZero. This will lead to uninitialized or incorrect values being used for gas calculations and success determination in Osaka MODEXP operations.
Note
Refactors MODEXP/Blake2f tracing into fork-specific (London/Osaka) modules with updated hubs/MMU/OOB flows and counting, enabling Osaka (EIP‑7823/7883) behavior and updating tests accordingly.
BlakeModexp,BlakeModexpOperation,ModexpMetadata, and OOB calls for MODEXP size/pricing/XBS; add fork-specific London/Osaka implementations.LondonModexpSubsectionandOsakaModexpSubsection; fork-selected inCallSection.BlakeModexp; tracing lists updated to include it.ZkCounterset toPRAGUE; counts MODEXP/Blake viaModexpMetadata.getNumberOfRowsForModexp()andnumberOfRowsBlake(); selects London/Osaka metadata by fork.Written by Cursor Bugbot for commit 613c290. This will update automatically on new commits. Configure here.