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

Bump to latest Plutarch #52

Merged
merged 6 commits into from
Sep 14, 2024
Merged

Bump to latest Plutarch #52

merged 6 commits into from
Sep 14, 2024

Conversation

kozross
Copy link
Member

@kozross kozross commented Jul 9, 2024

No description provided.

Copy link
Contributor

@albertodvp albertodvp left a comment

Choose a reason for hiding this comment

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

I think we need this to make example compile and CI pass

example/src/Example/NftM.hs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@kozross kozross marked this pull request as ready for review July 10, 2024 19:13
kozross and others added 2 commits July 11, 2024 07:20
Co-authored-by: Alberto Fanton <alberto.fanton@protonmail.com>
Co-authored-by: Alberto Fanton <alberto.fanton@protonmail.com>
@@ -1,3 +1,8 @@
# 0.7.0 - Bump plutus version to 1.30.0.0

- Renamed `ValidatorRole` and `MintingPolicyRole` to `ThreeArgumentScript` and `TwoArgumentScript`.
Copy link
Collaborator

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 to newtypes. This is the same concept. Unifying should instead be done at the instance and usage level. You could have parseStakeValidator and parseMintingPolicy 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 and runScript 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.

Copy link
Collaborator

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.

Copy link
Collaborator

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 role TwoArgumentScript. 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.

Copy link
Collaborator

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 newtypes often carry invariants, therefore not being redundant.

Copy link
Contributor

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 IMHO

Copy link
Contributor

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

Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like this one's different from the one linked at cardano.org, but it seems more promising.

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?

Copy link
Collaborator

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.

@TotallyNotChase
Copy link
Collaborator

Could the changes to the role be removed please so we can merge the Plutarch bump? Let's leave that or any similar changes to a separate PR.

I can make the changes myself if necessary. cc @kozross

@TotallyNotChase TotallyNotChase changed the base branch from master to plutarch-update September 14, 2024 18:27
@TotallyNotChase
Copy link
Collaborator

I'm merging this in to get the Plutarch update in but I will have to rollback the script arg changes.

@TotallyNotChase TotallyNotChase merged commit 79fdedb into plutarch-update Sep 14, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants