Skip to content

Conversation

@orizi
Copy link
Collaborator

@orizi orizi commented Jan 4, 2026

Summary

Reduced the gas cost for the box::local_into libfunc from 3 steps to 2 steps. This change is reflected in the core libfunc cost calculation and updates the expected function costs in the box e2e tests.


Type of change

Please check one:

  • Performance improvement
  • Bug fix (fixes incorrect behavior)
  • New feature
  • Documentation change with concrete technical impact
  • Style, wording, formatting, or typo-only change

Why is this change needed?

The box::local_into libfunc was using more gas steps than necessary. After analysis, it was determined that 2 steps is sufficient for this operation, which will reduce the gas cost for functions using this libfunc.


What was the behavior or documentation before?

The box::local_into libfunc was costing 3 gas steps, which resulted in higher function costs in the e2e tests.


What is the behavior or documentation after?

The box::local_into libfunc now costs 2 gas steps, reducing the overall gas cost for functions that use this operation. The e2e test function costs have been updated to reflect this change, with most functions seeing a 100-unit reduction in cost.

@reviewable-StarkWare
Copy link

This change is Reviewable

@orizi orizi marked this pull request as ready for review January 4, 2026 12:43
@orizi orizi force-pushed the orizi/01-04-fixed_cost_of_local_into_box_cost branch from de53850 to 9f31b76 Compare January 4, 2026 14:01
@orizi orizi force-pushed the orizi/01-04-refactored_box_getting_libfuncs_by_cellexpression_add_with_const_ branch from b275fd7 to dd8b310 Compare January 4, 2026 14:01
Copy link
Collaborator

@TomerStarkware TomerStarkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

@TomerStarkware reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware and @liorgold2).

@orizi orizi force-pushed the orizi/01-04-refactored_box_getting_libfuncs_by_cellexpression_add_with_const_ branch from dd8b310 to 26aa831 Compare January 12, 2026 11:54
@orizi orizi force-pushed the orizi/01-04-fixed_cost_of_local_into_box_cost branch from 9f31b76 to c0ecad6 Compare January 12, 2026 11:54
SIERRA_UPDATE_PATCH_CHANGE_TAG=Not yet released libfunc.
@orizi orizi changed the base branch from orizi/01-04-refactored_box_getting_libfuncs_by_cellexpression_add_with_const_ to graphite-base/9396 January 12, 2026 12:11
@orizi orizi force-pushed the graphite-base/9396 branch from 26aa831 to 3fd8d15 Compare January 12, 2026 12:12
@orizi orizi force-pushed the orizi/01-04-fixed_cost_of_local_into_box_cost branch from c0ecad6 to 0cd2a74 Compare January 12, 2026 12:12
@orizi orizi changed the base branch from graphite-base/9396 to main January 12, 2026 12:12
@orizi orizi enabled auto-merge January 12, 2026 12:13
@orizi orizi added this pull request to the merge queue Jan 12, 2026
Merged via the queue into main with commit 50d7101 Jan 12, 2026
108 checks passed
@orizi orizi deleted the orizi/01-04-fixed_cost_of_local_into_box_cost branch January 12, 2026 14:32
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.

4 participants