tweag / cooked-validators

MIT License
39 stars 11 forks source link

Monad attacks #154

Closed carlhammann closed 1 year ago

carlhammann commented 2 years ago

This PR defines

newtype Attack a = Attack (MockChainSt -> TxSkel -> [(TxSkel, a)])

and uses the fact that this type is a monad with branching and failure capabilities to rework our attack language. A good first example to see this in action is probably the simplest of the "big" attacks: The token duplication attack.

This is not yet completely finished, in particular:

However, it's ready for feedback and review!

If merged, this PR will close #143 .

facundominguez commented 2 years ago

I edited my review to add nothing less than the positive feedback. Please, excuse me for the hiccup.

carlhammann commented 1 year ago

So, let me summarise the state of this PR:

carlhammann commented 1 year ago

I think that my last question is interesting enough to warrant its own issue, which I opened: #165. For the purposes of this PR, I think we should leave sameConstraints as it is.

carlhammann commented 1 year ago

In my perception, after talking to many of you, all unanswered questions are now recorded as issues, and only these two remain:

facundominguez commented 1 year ago

Is the documentation of the doubleSatAttack understandable now?

I think is much better. Thanks.

Do we have a better word than "Attack"?

Tweak is good. Should it be plural? An attack can produce more than one modification, right? A long name would be TransactionModifications which could be compressed to TxMods perhaps.