Skip to content

Conversation

nadir-akhtar
Copy link
Contributor

Motivation:

As discovered during audit, BN254TableCalculatorBase._calculateOperatorTable incorrectly uses i for the index when collecting registered operators rather than operatorCount, leading to malformed arrays. The corresponding test intended to validate this behavior but failed to.

Modifications:

  • Correct contract implementation
  • Fix test to correctly fail when array is malformed, and pass when it is correctly constructed and the root matchees

Result:

Auditing finding addressed, correct code and tests

@nadir-akhtar nadir-akhtar force-pushed the nadir/bn254-table-calculator-base-fix branch from 5288a6b to 90a8d18 Compare July 19, 2025 00:41
@nadir-akhtar nadir-akhtar requested a review from ypatil12 July 19, 2025 22:24
@ypatil12 ypatil12 changed the title fix: correct array indexing for BN254TableCalculatorBase._calculateOperatorTable fix(H-1): correct array indexing for BN254TableCalculatorBase._calculateOperatorTable Jul 25, 2025
Copy link
Collaborator

@ypatil12 ypatil12 left a comment

Choose a reason for hiding this comment

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

LGTM

@ypatil12 ypatil12 merged commit dcd6ee3 into dev Jul 25, 2025
9 checks passed
@ypatil12 ypatil12 deleted the nadir/bn254-table-calculator-base-fix branch July 25, 2025 14:52
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