Skip to content

Conversation

@avivg-starkware
Copy link
Contributor

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

Note

Medium Risk
Touches core gas/weight accounting used for block capacity and fee-related limits; mistakes could shift proving-gas totals and affect block admission decisions.

Overview
Updates proving-gas calculation to operate directly on CairoPrimitiveCounterMap rather than converting from builtin-only counters.

In get_tx_weights, the proving-gas path now builds Cairo-primitive counters from OS VM builtins and merges in the transaction’s Cairo-primitive counters (to avoid double-counting tx_vm_resources), then uses these counters consistently through compute_proving_gas/proving_gas_from_cairo_primitives_and_sierra_gas.

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

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

avivg-starkware commented Feb 10, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/compute_proving_gas_for_cairo_primitives branch 2 times, most recently from bf253d4 to 7abd78e Compare February 10, 2026 14:35
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/cairo_primitives_to_gas branch from ddde9e6 to 2c59ece Compare February 10, 2026 14:50
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/compute_proving_gas_for_cairo_primitives branch from 7abd78e to 8bf6bd2 Compare February 10, 2026 14:50
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/cairo_primitives_to_gas branch from 2c59ece to 4a50c7f Compare February 10, 2026 14:52
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/compute_proving_gas_for_cairo_primitives branch 2 times, most recently from 2d7e0f6 to d6b5bfd Compare February 10, 2026 14:56
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/cairo_primitives_to_gas branch from 4a50c7f to 31ccc82 Compare February 10, 2026 14:56
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 1 files reviewed, 1 unresolved discussion.


crates/blockifier/src/bouncer.rs line 900 at r1 (raw file):

    // TODO(AvivG): To support opcodes in the computation, os resources should include opcode
    // counters.

Will happen as part of modifying tx_resources.computation.os_vm_resources

Code quote:

    // TODO(AvivG): To support opcodes in the computation, os resources should include opcode
    // counters.

@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/compute_proving_gas_for_cairo_primitives branch from d6b5bfd to 7a891bf Compare February 10, 2026 15:26
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/cairo_primitives_to_gas branch from 31ccc82 to f0672b5 Compare February 10, 2026 15:44
@avivg-starkware avivg-starkware force-pushed the avivg/blockifier/compute_proving_gas_for_cairo_primitives branch from 7a891bf to 698ceda Compare February 10, 2026 15:44
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