Skip to content

Conversation

@chfast
Copy link
Member

@chfast chfast commented May 29, 2025

Refactor modexp gas calculation to help with #1242.

@chfast chfast requested review from Copilot and rodiazet May 29, 2025 09:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the modexp gas calculation to address issue #1242 by updating lambda functions and parameter extraction for improved consistency and clarity.

  • Updated lambda parameters from ambiguous names (y) to descriptive ones (max_len)
  • Refactored the selection of gas calculation parameters using a lambda that returns a Params struct
  • Streamlined calculation logic in both calc_mult_complexity functions
Comments suppressed due to low confidence (1)

test/state/precompiles.cpp:142

  • [nitpick] Consider renaming the lambda used for parameter selection to a descriptive name (e.g., 'get_params') to improve readability.
const auto& [min_gas, final_divisor, calc_mult_complexity] = [rev]() noexcept -> Params {

@chfast chfast enabled auto-merge (squash) May 29, 2025 09:41
@chfast chfast disabled auto-merge May 29, 2025 09:47
@chfast chfast merged commit 69525e9 into master May 29, 2025
24 checks passed
@chfast chfast deleted the modexp-refactor branch May 29, 2025 09:47
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.

3 participants