Skip to content

Conversation

@d0cd
Copy link
Collaborator

@d0cd d0cd commented Oct 20, 2025

This PR adds support for estimating the number of variables, the number of constraints, the finalize cost, and the total execution cost. It is added to the deployment summary and looks like:

🔍 Function 'claim' Cost Breakdown
  Variables:            24,537
  Constraints:          17,818
  Finalize Cost:        0.002488
  Execution Cost:       0.004991

🔍 Function 'pay_for_gas' Cost Breakdown
  Variables:            28,921
  Constraints:          21,079
  Finalize Cost:        0.003843
  Execution Cost:       0.006668

🔍 Function 'init_merkle_tree' Cost Breakdown
  Variables:            16,968
  Constraints:          12,072
  Finalize Cost:        0.027868
  Execution Cost:       0.029234

🔍 Function 'post_dispatch' Cost Breakdown
  Variables:            76,746
  Constraints:          46,711
  Finalize Cost:        0.132780
  Execution Cost:       0.149814

@vicsn
Copy link
Collaborator

vicsn commented Oct 20, 2025

It might be less confusing to visualize that other costs are subcomponents, e.g.:

- total execution cost: X
|-> finalize cost: y
|-> storage cost: z 

Or:

| finalize cost: y
| storage cost: z 
-------------- +
| total cost: x

Base automatically changed from feat/hash-raw-ecdsa-ops to mainnet October 21, 2025 11:45
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