EspressoSystems / espresso-sequencer

96 stars 68 forks source link

I16: Redundant function evaluateLagrangeOne #1752

Closed philippecamacho closed 1 month ago

philippecamacho commented 2 months ago

Affected Code: PolynomialEval.sol (line 115)

Summary: The function evaluateLagrangeOne computes the first Lagrange polynomial evaluation. However, this evaluation is also calculated as an intermediate result in the function evaluatePiPoly.

Suggestion: We recommend removing the evaluateLagrangeOne function and modifying evaluatePiPoly to return both the first Lagrange polynomial evaluation and the public input polynomial evaluation. This change would optimize gas usage and reduce code complexity.

philippecamacho commented 1 month ago

As discussed with @alxiong in #1827, we prefer to prioritize code clarity and thus keep the function evaluateLagrangeOne.