Skip to content

Conversation

@letypequividelespoubelles
Copy link
Collaborator

@letypequividelespoubelles letypequividelespoubelles commented Oct 10, 2025

Note

Enables full tracing/counting for BLAKE2f and RIPEMD precompiles, refactors MOD row accounting and BLS handling, and removes legacy precompile-exclusion modules/tests.

  • Hub/Precompile handling:
    • BLAKE2f: add NB_ROWS_HUB_PRC_BLAKE, count BLAKE_MODEXP_DATA rows, and update OOB tallies.
    • RIPEMD: enable SHARIP/OOB/MOD updates and block counting in ripemdBlocks.
    • Generalize MOD row accounting via modLinesComingFromOobCall(prc); applied to SHA2/RIPEMD/IDENTITY/MODEXP/ECPAIRING/BLS.
    • BLS: validate call data sizes (validCallDataSize) and invoke BlsData; update OOB/MOD tallies.
  • Modules/ops:
    • Expose NB_ROWS_BLAKEMODEPX_BLAKE; convert related constants to short.
    • Remove POINT_EVAL/BLS modules and associated event-detection paths from Hub/ZkCounter/ModuleName.
    • IncrementAndDetectModule no longer blocks commit on detected events.
  • Tests/infra:
    • Delete CancunAndPraguePrecompilesExcludedTests and drop POINT_EVAL/BLS expectations in tests.
    • Run reference and toy environments without exclusion try-catches; compare tracer vs counter counts as updated.

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

Signed-off-by: F Bojarski <[email protected]>
@letypequividelespoubelles letypequividelespoubelles linked an issue Oct 10, 2025 that may be closed by this pull request
@letypequividelespoubelles letypequividelespoubelles linked an issue Oct 16, 2025 that may be closed by this pull request
if (precompile.isAnyOf(PRC_BLS_G1_MSM, PRC_BLS_G2_MSM)) {
mod.updateTally(2 * NB_ROWS_MOD); // coming from OOB call
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

LGTM, maybe add here that a comment saying that for PAIRING_CHECK we have a calll to DIV, while for MSM a call to DIV and one to MSM.

Copy link
Collaborator

Choose a reason for hiding this comment

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

while for MSM a call to DIV and one to MSM

What do you mean @lorenzogentile404 ? Do you mean DIV and MOD ?

&& cds % PRECOMPILE_CALL_DATA_UNIT_SIZE___BLS_PAIRING_CHECK == 0;
default -> throw new IllegalArgumentException("not implemented for prc: " + prc);
};
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe the cases could be ordered by increasing addresses.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes

Copy link
Collaborator

@OlivierBBB OlivierBBB left a comment

Choose a reason for hiding this comment

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

LGTM

// TODO: temporary commented out
// blsdata.callBls(0, precompile, frame.getInputData(), returnData, prcSuccess);
if (validCallDataSize(precompile, callDataSize)) {
blsdata.callBls(0, precompile, frame.getInputData(), returnData, prcSuccess);
Copy link
Collaborator

Choose a reason for hiding this comment

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

A BLS precompile call triggers a BLS_DATA call as soon as the call data is of the right size and gas is sufficient. Why use a partial condition ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

because in ZkCounter, we're plugged at tracePrecompileCall which is trigger only if enough gas if I'm not mistaken whereas the hub is trigger by the call preOpcode

if (precompile.isAnyOf(PRC_BLS_G1_MSM, PRC_BLS_G2_MSM)) {
mod.updateTally(2 * NB_ROWS_MOD); // coming from OOB call
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

while for MSM a call to DIV and one to MSM

What do you mean @lorenzogentile404 ? Do you mean DIV and MOD ?

@letypequividelespoubelles letypequividelespoubelles merged commit e198e5d into arith-dev Oct 23, 2025
15 checks passed
@letypequividelespoubelles letypequividelespoubelles deleted the 2414-feat-forced-transaction branch October 23, 2025 07:36
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.

reenable bls and kzg line count feat: forced transaction Enable callBls in the ZkCounter when enabling BLS precompiles in the tracer

4 participants