Skip to content

Conversation

@avivg-starkware
Copy link
Contributor

@avivg-starkware avivg-starkware commented Feb 10, 2026

Note

Low Risk
Small, additive API change limited to gas-cost lookup logic; minimal risk unless downstream callers rely on the old builtin-only access pattern.

Overview
Adds support in BuiltinGasCosts (within blockifier_versioned_constants.rs) to look up gas costs by a CairoPrimitiveName, unifying builtins and opcode pricing under get_cairo_primitive_gas_cost.

Introduces opcode-specific lookup via get_opcode_gas_cost (currently covering OpcodeName::Blake) and wires in the required imports; no gas values change, only how callers can access them.

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

@reviewable-StarkWare
Copy link

This change is Reviewable

@github-actions
Copy link

github-actions bot commented Feb 10, 2026

Copy link
Contributor Author

avivg-starkware commented Feb 10, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor Author

@avivg-starkware avivg-starkware left a comment

Choose a reason for hiding this comment

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

@avivg-starkware made 1 comment.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion.


crates/blockifier/src/blockifier_versioned_constants.rs line 950 at r2 (raw file):

impl BuiltinGasCosts {
    pub fn get_builtin_gas_cost(&self, builtin: &BuiltinName) -> Result<u64, GasCostsError> {

This will be made private, and outer use will only be by fn get_cairo_primitive_gas_cost
(I added TODO in the following PR #12462)

Code quote:

pub fn get_builtin_gas_cost(&self, builtin: &BuiltinName) -> Result<u64, GasCostsError> {

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