-
Notifications
You must be signed in to change notification settings - Fork 158
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
No extra redeemers #2392
No extra redeemers #2392
Conversation
let extraRdmrs :: [RdmrPtr] | ||
extraRdmrs = | ||
Map.keys $ | ||
Map.filterWithKey | ||
(\el _ -> not $ elem (SJust el) [rdptr @era txbody sp | (sp, _) <- sphs]) | ||
(unRedeemers $ txrdmrs . wits $ tx) |
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.
A more efficient way of doing the same thing
let extraRdmrs :: [RdmrPtr] | |
extraRdmrs = | |
Map.keys $ | |
Map.filterWithKey | |
(\el _ -> not $ elem (SJust el) [rdptr @era txbody sp | (sp, _) <- sphs]) | |
(unRedeemers $ txrdmrs . wits $ tx) | |
let rdptrs = Set.fromList [el | (sp, _) <- sphs, SJust el <- [rdptr @era txbody sp]] | |
extraRdmrs :: [RdmrPtr] | |
extraRdmrs = Map.keys $ Map.withoutKeys (unRedeemers $ txrdmrs $ wits tx) rdptrs |
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.
We should also include a test, similar to the ones here:
@JaredCorduan do you happen to know why "Chain and Ledger traces cover the relevant cases" is failing now? I have no idea what to do about that... |
yea, the alonzo traces are still flakey, it's very frustrating. no tests are really failing, it's that we do not get a high enough percentage of good traces:
Once the PR is ready to merge, I can always re-run the tests if this happens again. |
I added a test with an extra redeemer - so it could be ready, unless more tests are needed |
fantastic, thank you! let me spin the wheel! 🎰 |
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.
looks good to me, thank you @polinavino !
I'm a bit confused about what this is doing, this looks like a weakening in the condition in the formal spec to me. Now, it's a check that all redeemers are required by |
And from reading the Haskell diff, it seems like this size check was just not implemented before? |
yea, youre right! fixing this now (adding the constraint that SP has to be for a non-native script). There was no check at all before I put the size check, and the reason I changed it from the size-check to the current one is that we want to be able to get a better error report (a list of the extra redeemers) |
Add a check to the UTXOW rule that forbids redeemers that have pointers that do not point to script purposes required for validation of the Tx's contracts