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

Explicit sanity checks for Transaction Skeletons #109

Closed
carlhammann opened this issue May 4, 2022 · 2 comments
Closed

Explicit sanity checks for Transaction Skeletons #109

carlhammann opened this issue May 4, 2022 · 2 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@carlhammann
Copy link
Contributor

The problem
We sometimes accidentally generate TxSkels that are invalid for reasons like missing inputs, negative Ada amounts, etc. (At least I hope I'm not the only one prone to such mistakes.) Yesterday, I spent more than an hour debugging because of a negative Ada amount that sent the validation into a loop, somehow.

Possible solution/Question
I'd like to have a function isSane :: SanityOptions -> TxSkel -> Bool, maybe also a function sanitize :: SanityOptions -> TxSkel -> TxSkel, for some suitable type SanityOptions, that I can call on my TxSkel and figure out if and how it is broken before handing it to validation.

If something like that already exists, it's at least hidden enough that I've not yet found it.

@carlhammann carlhammann added enhancement New feature or request question Further information is requested labels May 4, 2022
@VictorCMiraldo
Copy link
Contributor

I'm generally against adding a function sanitize because when we try to validate a transaction we will already get a number of errors indicating what's wrong with it.

I do agree that the amount of processing that happens under the hood with transaction processing is too much and can cause confusion.

@carlhammann
Copy link
Contributor Author

I think this is not anymore relevant with the attack language as of PR #154 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants