Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kwxm/mainnet script budgets #5973

Merged
merged 3 commits into from
May 14, 2024
Merged

Kwxm/mainnet script budgets #5973

merged 3 commits into from
May 14, 2024

Conversation

kwxm
Copy link
Contributor

@kwxm kwxm commented May 13, 2024

This is just a small PR to add an option to analyse-script-events to print out the CPU and memory costs of each script event.

@kwxm kwxm added No Changelog Required Add this to skip the Changelog Check Costing Anything relating to costs, fees, gas, etc. labels May 13, 2024
@kwxm kwxm requested a review from zliu41 May 13, 2024 17:08
@kwxm
Copy link
Contributor Author

kwxm commented May 13, 2024

Here's what the start of the output looks like. It can be read directly into R (in the form of a data frame) for further analysis.

         cpu     cpuFraction             mem    memFraction
      512081024   0.05120810           1426968   0.10192629
      540867862   0.05408679           1488026   0.10628757
      957982513   0.09579825           2846016   0.20328686
      512081024   0.05120810           1426968   0.10192629
      540867862   0.05408679           1488026   0.10628757
      957982513   0.09579825           2846016   0.20328686
      523569632   0.05235696           1447790   0.10341357
      940684283   0.09406843           2805780   0.20041286
      523569632   0.05235696           1447790   0.10341357
      940684283   0.09406843           2805780   0.20041286
...

Copy link
Member

@zliu41 zliu41 left a comment

Choose a reason for hiding this comment

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

Are you sure dataBudget is the claimed budget, not the actual budget? If it is not the actual budget, then why do we care about it?

@kwxm
Copy link
Contributor Author

kwxm commented May 14, 2024

Are you sure dataBudget is the claimed budget, not the actual budget? If it is not the actual budget, then why do we care about it?

I haven't checked the details in the script-dumping program, but I'm pretty sure that these are the claimed budgets (ie, the ones that the fees are based on). For example, about 7% of the events have memory budgets that are exact multiples of 1,000,000, and I think it's highly unlikely (about one chance in a million!) that that would occur as an actual cost.

The basic reason that I did it this way was that I was in a hurry: it took 2½ hours just to look at the scripts, and to get the real costs we would have had to execute them all, which would have taken a lot longer. Arguably it's useful to know these numbers anyway, but I'm going to claim that the numbers which aren't obviously made up are probably the real ones, and those account for probably over 90% of the data produced by this so it's still giving us useful information. I agree that it would be good to know the real costs as well and I may come back and do that later. I've added a TODO for that.

@kwxm kwxm enabled auto-merge (squash) May 14, 2024 11:51
@kwxm kwxm merged commit 6e3da00 into master May 14, 2024
7 checks passed
@kwxm kwxm deleted the kwxm/mainnet-script-budgets branch May 14, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Costing Anything relating to costs, fees, gas, etc. No Changelog Required Add this to skip the Changelog Check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants