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

[Bug] encode_with_signature_fields encodes an invalid transaction when the signature Parity is unexpected #1510

Open
kayabaNerve opened this issue Oct 17, 2024 · 0 comments · May be fixed by #1496
Assignees
Labels
bug Something isn't working

Comments

@kayabaNerve
Copy link
Contributor

Component

consensus, eips, genesis

What version of Alloy are you on?

84dfc7a

Operating System

None

Describe the bug

TxLegacy::encode_with_signature_fields with a Signature constructed with From<Signature<Secp256k1>>::from used to work in my setup until that (its own bug) was patched with #1305. #1428 corrected this for such signatures when TxLegacy::into_signed is used yet encode_with_signature_fields remains an issue.

TxLegacy::encode_with_signature_fields should either return an error when an incorrect parity is passed or also coerce it as into_signed did. I'm happy to implement either solution once informed which would be preferable. I'd assume (and personally recommend) coercion. The other transaction types may have similar issues but I have yet to look.

I'll also note I initially raised/misdiagnosed this in foundry-rs/foundry#9046.

@kayabaNerve kayabaNerve added the bug Something isn't working label Oct 17, 2024
kayabaNerve added a commit to serai-dex/serai that referenced this issue Oct 17, 2024
Mainly corrects for alloy-rs/alloy#1510 yet also
corrects a missing machete ignore.
@prestwich prestwich linked a pull request Oct 19, 2024 that will close this issue
3 tasks
@prestwich prestwich linked a pull request Oct 19, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@kayabaNerve @klkvr and others