Skip to content

Conversation

@avivg-starkware
Copy link
Contributor

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

Note

Low Risk
Small, additive API surface in gas-cost lookup logic with no changes to pricing values or transaction execution flow.

Overview
Adds support for querying gas costs by Cairo primitive name (builtin or opcode) in BuiltinGasCosts.

This introduces get_opcode_gas_cost (currently mapping OpcodeName::Blake) and a unified get_cairo_primitive_gas_cost that dispatches to either builtin pricing (with existing error handling) or opcode pricing.

Written by Cursor Bugbot for commit 8469e09. 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

@avivg-starkware avivg-starkware marked this pull request as ready for review February 10, 2026 13:26
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/get_cairo_primitive_cost branch from dfeb234 to 48bc7b3 Compare February 10, 2026 14:00
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