Skip to content

Conversation

@kwxm
Copy link
Contributor

@kwxm kwxm commented May 8, 2025

Fixes https://github.com/IntersectMBO/plutus-private/issues/1448
Fixes https://github.com/IntersectMBO/plutus-private/issues/1554

The earlier PR (#7071) for this measured sizes of inputs in bytes (not words) in order to get a high-resolution view of the data. I redid it with the standard size measure (8-byte words) and the results were just as accurate, so I decided to use that instead and open a new PR since it simplifies things a lot.

Some costs calculated according to the new costing function:

Size in words Size in bits Percentage of maximum budget
2 128 0.02%
4 256 0.07%
8 512 0.42%
16 1024 2.77%
32 2048 19.8%
56 3584 100.6%

This seems reasonable for realistic input sizes, and it's actaully a bit cheaper than the previous version.

@kwxm kwxm added Costing Anything relating to costs, fees, gas, etc. No Changelog Required Add this to skip the Changelog Check labels May 8, 2025
@kwxm kwxm temporarily deployed to github-pages May 8, 2025 05:42 — with GitHub Actions Inactive
@kwxm kwxm mentioned this pull request May 8, 2025
@kwxm kwxm requested a review from zliu41 May 8, 2025 05:45
@@ -1 +1 @@
Integer -> Integer -> Natural -> BuiltinResult Natural No newline at end of file
IntegerCostedByNumBytes -> IntegerCostedByNumBytes -> IntegerCostedByNumBytes -> BuiltinResult Natural No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

How are these golden files generated? I don't see a type called IntegerCostedByNumBytes in the codebase?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I removed that. I updated most of the golden files but must have forgotten this one. I'll fix that.

@kwxm kwxm temporarily deployed to github-pages May 8, 2025 20:19 — with GitHub Actions Inactive
@kwxm kwxm temporarily deployed to github-pages May 9, 2025 02:11 — with GitHub Actions Inactive
@kwxm kwxm merged commit bc4c2d0 into master May 9, 2025
26 checks passed
@kwxm kwxm deleted the kwxm/costing/expModInteger-3 branch May 9, 2025 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Builtins Costing Anything relating to costs, fees, gas, etc. Crypto No Changelog Required Add this to skip the Changelog Check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants