alloy-rs / core

High-performance, well-tested & documented core libraries for Ethereum, in Rust
https://alloy.rs
Apache License 2.0
758 stars 131 forks source link

feat(primitives): serialize yParity and v simultaneously #661

Closed yash-atreya closed 3 weeks ago

yash-atreya commented 2 months ago

Motivation

Previously, when v was set to 0x0 || 0x1 i.e Parity::Parity(false || true), only yParity would appear in the serialized form of the sig.

Solution

Serialize v along with yParity in that case. Ref: https://github.com/ethereum/go-ethereum/blob/473ee8fc07a3f89cf3978e164a6fad218de9a6b5/internal/ethapi/api.go#L1342-L1345

PR Checklist