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

redeemers check mistake #2393

Merged
merged 1 commit into from
Aug 4, 2021
Merged

redeemers check mistake #2393

merged 1 commit into from
Aug 4, 2021

Conversation

polinavino
Copy link
Contributor

as @WhatisRT points out, the current check for extra redeemers allowed redeemers for non-native scripts : (
this fixes that

JaredCorduan
JaredCorduan previously approved these changes Jul 23, 2021
Copy link
Contributor

@JaredCorduan JaredCorduan left a comment

Choose a reason for hiding this comment

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

good catch!

@JaredCorduan
Copy link
Contributor

The unit test for "missing 2-phase script witness" is now also returning an addition predicate failure, namely:

ExtraRedeemers [RdmrPtr Mint 1,RdmrPtr Cert 1,RdmrPtr Rewrd 0]

Something seems wrong...

@JaredCorduan JaredCorduan dismissed their stale review July 23, 2021 18:40

unexpected test failure

@polinavino
Copy link
Contributor Author

those were redeemers for phase-1 scripts, there is only 1 phase-2 script (used for 1 purpose, so needs 1 redeemer, and the transaction has a total of 4)

@polinavino
Copy link
Contributor Author

polinavino commented Jul 24, 2021

The example failure is fixed.. but now I do not understand why this is happening.. is it something to do with recent changes?:

@nc6 it looks like the same error as in the latest merged PR build?

`[6 of 9] Compiling Test.Cardano.Ledger.Alonzo.Tools ( test/Test/Cardano/Ledger/Alonzo/Tools.hs, dist/build/cardano-ledger-alonzo-test/cardano-ledger-alonzo-test-tmp/Test/Cardano/Ledger/Alonzo/Tools.o, dist/build/cardano-ledger-alonzo-test/cardano-ledger-alonzo-test-tmp/Test/Cardano/Ledger/Alonzo/Tools.dyn_o )

test/Test/Cardano/Ledger/Alonzo/Tools.hs:22:1: error:
Could not find module ‘Cardano.Ledger.Tx’
Perhaps you meant
Cardano.Ledger.Era (from cardano-ledger-core-0.1.0.0)
Cardano.Ledger.Val (from cardano-ledger-core-0.1.0.0)
Cardano.Ledger.Coin (from cardano-ledger-core-0.1.0.0)
Use -v (or :set -v in ghci) to see a list of the files searched for.
|
22 | import qualified Cardano.Ledger.Tx as Core`

@nc6
Copy link
Contributor

nc6 commented Jul 24, 2021

Ah, maybe suggests an out-of-order merge issue. I'll fix separately.

@WhatisRT
Copy link
Contributor

I think we can cut down on the complexity now, if we really don't want the size check. checkScriptData can simply check if all the required scripts are present (and no redeemer checks, so the name should probably be changed) and we can simply do all the checks on the redeemers in this set comparison. I'll push a change to the spec that does this to this PR

@WhatisRT
Copy link
Contributor

I made the changes to the formal spec we just discussed

@WhatisRT
Copy link
Contributor

These changes also made it obvious that we've been checking that all the scripts are present twice, so I've removed that duplicate as well. UTXOW looks a lot simpler now :)

@polinavino
Copy link
Contributor Author

Thank you!!

@polinavino polinavino force-pushed the polina/redeemers2 branch 2 times, most recently from 0f1861b to ba20b8e Compare July 28, 2021 18:47
JaredCorduan
JaredCorduan previously approved these changes Aug 3, 2021
Copy link
Contributor

@JaredCorduan JaredCorduan left a comment

Choose a reason for hiding this comment

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

LGTM!

ExtraRedeemers
[ RdmrPtr Tag.Mint 1,
RdmrPtr Tag.Cert 1,
RdmrPtr Tag.Rewrd 0
Copy link
Contributor

Choose a reason for hiding this comment

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

So this predicate failure is happening because the lack of script witness means that we do not know that the script hash is a plutus script, and hence these look superfluous?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, there is no plutus/phase-2 script validating those three things

@JaredCorduan JaredCorduan dismissed their stale review August 3, 2021 13:34

approved too soon...

Copy link
Contributor

@WhatisRT WhatisRT 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 what's in here is technically equivalent to what's in the spec but it's not obvious. If someone else agrees, we could merge it and fix it later (probably as part of our current ongoing audit)

alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxow.hs Outdated Show resolved Hide resolved
alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxow.hs Outdated Show resolved Hide resolved
alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxow.hs Outdated Show resolved Hide resolved
Copy link
Contributor

@JaredCorduan JaredCorduan left a comment

Choose a reason for hiding this comment

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

LGTM

@WhatisRT
Copy link
Contributor

WhatisRT commented Aug 4, 2021

I think we can merge this now, I'd probably like Polina to have another look at this but we probably don't want to wait till she's back

@JaredCorduan JaredCorduan merged commit 770de86 into master Aug 4, 2021
@iohk-bors iohk-bors bot deleted the polina/redeemers2 branch August 4, 2021 18:55
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.

4 participants