Skip to content

Conversation

@OlivierBBB
Copy link
Collaborator

@OlivierBBB OlivierBBB commented Nov 7, 2025

Note

Implements EIP-7823 for Osaka MODEXP (1024-byte bound, new pricing, normalized byte sizes), adds Osaka blake2fmodexpdata and refactors HUB/MMU/OOB logic; updates constants and Makefile module wiring.

  • Osaka MODEXP (EIP-7823):
    • Add GAS_CONST_MODEXP_EIP_7823 and EIP_7823_MODEXP_UPPER_BYTE_SIZE_BOUND to constants/constants.lisp.
    • Rework pricing to use ceil(max(mbs,bbs)/8)^2 with a 500 min cost; gate success/return-gas on bounds and gas comparisons.
    • Normalize bbs/ebs/mbs with in-bounds flags; use normalized sizes throughout extraction, offsets, and partial result copies; set result copy size to 1024.
    • Split/refactor HUB constraints for MODEXP common flow into granular files (__01__..__06__, generalities.lisp, justifying_hub_predictions.lisp); add automatic vanishing for inactive misc sub-perspectives (EXP/MMU/MXP/OOB/STP).
    • MMU: bump NB_MICRO_ROWS_TOT_MODEXP_{ZERO,DATA} to 64; update modexp_data to use EIP_7823_MODEXP_UPPER_BYTE_SIZE_BOUND and revised preprocessing counts.
  • New data module (Osaka):
    • Add blake2fmodexpdata/osaka (columns.lisp, constants.lisp with INDEX_MAX_MODEXP 63, constraints.lisp, WCP lookup) and wire via Makefile.
  • OOB updates:
    • Add Osaka modexp/xbs, modexp/lead, modexp/pricing with bound checks and new outputs; rename comparison helper to comparison-to-512 in non-Osaka forks.
  • Build wiring (Makefile):
    • Introduce fork-specific BLAKE2f_MODEXP_DATA_{LONDON,OSAKA} and include in ZKEVM_MODULES_*; wire Osaka modules (HUB_OSAKA, MMU_OSAKA, TRM_OSAKA, etc.).

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


(defun (precompile-processing---MODEXP---call-EXP-to-analyze-leading-word) (shift misc/EXP_FLAG precompile-processing---MODEXP---misc-row-offset---leading-word-analysis))
(defun (precompile-processing---MODEXP---call-MMU-to-extract-leading-word) (shift misc/MMU_FLAG precompile-processing---MODEXP---misc-row-offset---leading-word-analysis))
(defun (precompile-processing---MODEXP---call-OOB-on-leading-word-row) (shift misc/MMU_FLAG precompile-processing---MODEXP---misc-row-offset---leading-word-analysis))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: OOB Flag Reference Bug in Precompile Module

The function precompile-processing---MODEXP---call-OOB-on-leading-word-row incorrectly references misc/MMU_FLAG instead of misc/OOB_FLAG. This causes the function to return the MMU flag value when it should return the OOB flag value, breaking the constraint on line 37 that expects this function to equal 1 when the OOB module is active.

Fix in Cursor Fix in Web

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants