Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Bump to latest Plutarch #52
Bump to latest Plutarch #52
Changes from 4 commits
7c77122
a0aa368
57e82ad
7fb83df
ddd820a
a2c379a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I don't see the point behind this change. I think it's not only unnecessary, but perhaps also backwards.
The roles communicate to the user the purpose of a script. We have not removed any ambiguity, but added more.
TwoArgumentScript
does not tell us whether it's a minting policy or a staking validator, yet their usage is vastly different.Unifying should not be done at a type level. After all,
type
aliases are almost always inferior tonewtype
s. This is the same concept. Unifying should instead be done at the instance and usage level. You could haveparseStakeValidator
andparseMintingPolicy
both use common helpers, but it's important for both of them to actually check the role.The argument that "runMintingPolicy" and "runStakingValidator" have the same implementation seems moot. Just alias them. They are usage site, it's fine to alias them there. Or even have
runScriptWithDatum
andrunScript
depending on how you want the interface to be. Notice how all these changes are losing information downstream. It doesn't seem correct to lose the information at the source.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.
Furthermore, the ecosystem is much more aware of the terms "StakingValidator", "Validator", "MintingPolicy". Introducing new terms (though they are very simple terms) seems weird. I have never seen any project so far refer to them as "ThreeArgumentScript" and "TwoArgumentScript" - but this point is far less relevant than the fact that we are losing information by this transformation.
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.
Hi @TotallyNotChase, I'm the one who introduced the naming in the last PR. This comes from the idea that we cannot distinguish between a stake validator and a minting policy. I don't know what is more confusing: having a staking validator with the role
MintingPolicyRole
or one with the roleTwoArgumentScript
. The only information that got lost in the script role is, as far as I remember, the script's versioning. I agree that the script role does not make sense anymore. Perhaps we should drop it.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.
My point is that there can be a new role for StakeValidator. Again, this is not redundant because this is essentially a typing component. Same way as
newtype
s often carry invariants, therefore not being redundant.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.
Is that role description really relevant? In V3, we will have even more unified scripts. From that perspective, I don't think keeping those roles will be very useful in the future; it might increase confusion. Adding a new role for
StakeValidator
does not add much value and is not particularly future-proof IMHOThere 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.
Here is the CIP: CIP-0069
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.
Ah I see, It's this one! It's been a long time but I remember this from back when Maks actually proposed it (he used to work at MLabs).
Anyway, this isn't actually an approved CIP and it has been in talks for awhile. There's no actual indication that it'll be approved and implemented. I remember Las liked the idea back when me and him were initially building Plutarch but it never ended up affecting any development since it was never even close to being actually approved.
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.
Unless we're talking about this one: cardano-foundation/CIPs#784 ?
It seems like this one's different from the one linked at
cardano.org
, but it seems more promising.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.
What do you mean? Do you see differences between the link I've shared and that PR? To me it seems the diffs into that branch were ported into cardano.org (actually I assume that page is automatically generated). Am I missing something?
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.
The linked CIP PR in the cardano.org page is the original old PR (the latest comment on it just says that it is not approved). But looks like the diffs are indeed from an updated PR that seems more promising.
I can see that happening in the future. And so, as I mentioned before, I'm totally open to removing roles entirely. But please not in this PR. In a separate PR in the future, when that CIP is actually implemented and the ecosystem has started moving towards it.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.