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

Simplify CostModel internals #3042

Closed
JaredCorduan opened this issue Sep 17, 2022 · 0 comments · Fixed by #3075
Closed

Simplify CostModel internals #3042

JaredCorduan opened this issue Sep 17, 2022 · 0 comments · Fixed by #3075
Assignees
Labels
💳 technical-debt Issues related to technical debt we introduced

Comments

@JaredCorduan
Copy link
Contributor

The CostModel type contains a Map Text Integer named cmMap:

https://github.com/input-output-hk/cardano-ledger/blob/3f5123c3ae009ec1ac2779410da6604a236e67f2/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts.hs#L231-L235

Change the type of cm to be [Integer].


Context for those curious

This map cmMap is only used by the ledger to create a Plutus evaluation context (of type EvaluationContext), and it is only stored in the ledger so that we can serialize it (deserializing it allows us to construct the EvaluationContext again).

The newest version of Plutus now follows this plan, and hence only needs [Integer] to be constructed (ie no longer a Map Text Integer).

Moreover, there is no longer any need to use the Text keys in the ledger. So costModelParamsNames and costModelParamsNamesSet can be deleted as a part of this change. (introduced here https://github.com/input-output-hk/cardano-ledger/pull/2992/files#diff-f481d9eb9f793235d9fc4a1965ec1e0a01bed313f90adb11dcd9aa099a4cd738R320-R326)

@JaredCorduan JaredCorduan added the 💳 technical-debt Issues related to technical debt we introduced label Sep 17, 2022
@teodanciu teodanciu self-assigned this Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💳 technical-debt Issues related to technical debt we introduced
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants