Skip to content

Conversation

@OlivierBBB
Copy link
Collaborator

@OlivierBBB OlivierBBB commented Nov 12, 2025

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.

  • Architecture (precompiles):
    • Introduce abstract BlakeModexp, BlakeModexpOperation, ModexpMetadata, and OOB calls for MODEXP size/pricing/XBS; add fork-specific London/Osaka implementations.
    • Split MODEXP precompile handling into LondonModexpSubsection and OsakaModexpSubsection; fork-selected in CallSection.
  • Hub/ZkCounter integration:
    • Hubs instantiate fork-specific BlakeModexp; tracing lists updated to include it.
    • ZkCounter set to PRAGUE; counts MODEXP/Blake via ModexpMetadata.getNumberOfRowsForModexp() and numberOfRowsBlake(); selects London/Osaka metadata by fork.
  • MMU/OOB updates:
    • MODEXP MMU instructions reference London micro-row constants; new OOB pricing/XBS logic with fork variants; adjusted return-data sizing for fork limits.
  • Misc/Tests:
    • Refactor imports and constants; update EXP/lead-log paths to new metadata package.
    • Tests updated to use fork-dependent component sizes and new module APIs.

Written by Cursor Bugbot for commit 613c290. This will update automatically on new commits. Configure here.

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) {
Copy link
Collaborator

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;
Copy link
Collaborator

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 ...

Copy link
Collaborator Author

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;
}
Copy link

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.

Fix in Cursor Fix in Web

With Lorenzo and François
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(
Copy link

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.

Fix in Cursor Fix in Web

protected BlakeModexpOperation getForkAppropriateBlakeModexpOperation() {
return new LondonBlakeModexpOperation(
getForkAppropriateModexpMetadata(), exoModuleOperationId());
}
Copy link

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.

Fix in Cursor Fix in Web

}

@Override
public void callExoModulesAndSetOutputs(Add add, Mod mod, Wcp wcp) {
Copy link

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants