-
Notifications
You must be signed in to change notification settings - Fork 488
BuiltinValue: insertCoin and unionValue and scaleValue costing #7384
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
base: master
Are you sure you want to change the base?
Conversation
a62c427 to
85884d2
Compare
|
@basetunnel you can work on costing scaleValue. |
65d6c9e to
52d9d21
Compare
|
|
||
| -- | Generate a unique PolicyId on a uniform distribution. Note that the size of the | ||
| -- generated bytestring is going to be larger than Value.maxKeyLen, because we | ||
| -- append a counter integer to ensure uniqueness. This is acceptable for benchmarking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it make insertCoin fail? It enforces key lengths.
| -- purposes, as we're interested in the worst-case performance. | ||
| newPolicyId :: StateGenM StdGen -> BenchState PolicyId | ||
| newPolicyId gen = do | ||
| bs <- uniformByteStringM Value.maxKeyLen gen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to fix the first 30 bytes, and randomize the last 2 bytes. That aligns better with worst case. I think that's what Yura's generator does, so you can probably reuse that.
Fixes https://github.com/IntersectMBO/plutus-private/issues/1899
Pre-submit checklist: