Skip to content

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

@kayabaNerve

Description

@kayabaNerve

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions