-
Notifications
You must be signed in to change notification settings - Fork 214
ContractModel: Detect Double Satisfaction Problems #501
Conversation
290dac6
to
280d271
Compare
@sjoerdvisscher we didn't touch this code, is something broken on main? |
What is a double satisfaction problem? |
|
@MaximilianAlgehed Hmm, it looks like a legitimate failure, and I don't see it on other branches. Did you try to run |
... It's a cached failure?! |
As far as I can tell it is cached from a previous build of this PR. |
This indeed fails locally but I'm absolutely stumped as to why - we haven't touched anything related to the PAB? |
c11b87c
to
02a48f8
Compare
@sjoerdvisscher there is a change to |
Yes, that's definitely how it's supposed to work. |
So then the old version was buggy (because of how do and infix notation
interact).
Best regards
*Maximilian Algehed*
…On Thu, 9 Jun 2022 at 18:38, Sjoerd Visscher ***@***.***> wrote:
the semantics should be that you only pay if phase 2 validation fails, no?
Yes, that's definitely how it's supposed to work.
—
Reply to this email directly, view it on GitHub
<#501 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBPPQOPKUIVBHCR7ZZKL3LVOIMZXANCNFSM5YCYN2KQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Then the fact that this test is broken tells us something. Is something broken in the PAB or is something broken elsewhere? |
@sjoerdvisscher I'll make a separate PR with that fix and hopefully that means we can dig into the issue in the PAB separately. |
Also, @sjoerdvisscher it would be good if you or someone could just have a look over this to make sure there is nothing absolutely insane going on :) |
😱
As a comment in the code says Don't forget to rebase on main to get the fix for the OOM CI issue. |
a7051e1
to
0823db7
Compare
@sjoerdvisscher: 43b73ac changed |
Ah sorry, I keep forgetting that we're not the only ones using these functions. You need something like this: idx' = case e of
Just (Index.Phase1, _) -> idx
Just (Index.Phase2, _) -> Index.insertCollateral txn idx
Nothing -> Index.insert txn idx |
Does that mean we should to switch to using |
That's right. |
… validation changes
0823db7
to
570a9d4
Compare
This PR introduces a new property to check for double satisfaction vulnerabilities in any contract with a
ContractModel
. This property is not complete, but as far as we know it is sound. See thecheckDoubleSatisfaction
property inPlutus.Contract.Test.ContractModel
.Pre-submit checklist: