-
Notifications
You must be signed in to change notification settings - Fork 149
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
feat: actually check push data bytes #743
feat: actually check push data bytes #743
Conversation
Is it possible to hit these new error paths? I think the |
Oh, of course, the script itself could be too large! Ok concept ACK. |
....which I think is also what's triggering your new tighter |
My trigger is actually just the error message of However, I've realized that it needs to allow the script itself from your comment... maybe we can allow 520 bytes(using The problem you mentioned might belong to |
I've added the logic to check the size of redeem script and other push separately 9dbaad3. Or we might change only the error message, which confuses. |
I would suggest squashing these two commits because they have substantial overlap in the code that they change. Secondly, I'm struggling to understand the point of calling My suggestion, if you want to make the assertion more precise, would be to add a Your method of checking whether we are on the last push is also pretty inefficient. One better way to do this is to add |
It can also be a real |
9dbaad3
to
324b33d
Compare
Thanks for great review! I've fixed following your suggestion. |
324b33d is looking great! But now it doesn't look like Could this PR be reduced to just adding the new assertions and not changing the signature of |
324b33d
to
e2e9281
Compare
You are right. No need to change the original signature. Reduced down by e2e9281! |
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.
ACK e2e9281 successfully ran local tests; thanks for iterating!
Miniscript witness item can be maximum 72 bytes(except length prefix), but it only throws error when it's >= 4294967296 bytes as only dependant on
PushBytesError
from bitcoin crate. I've changed the logic to check the maximum length internally so that actual check can be done.