alloy-rs / alloy

Transports, Middleware, and Networks for the Alloy project
https://alloy.rs
Apache License 2.0
584 stars 210 forks source link

feat(consensus): bincode compatibility for header and transaction types #1397

Closed shekhirin closed 1 day ago

shekhirin commented 3 days ago

Closes https://github.com/alloy-rs/alloy/issues/1349

Introduces the serde-bincode-compat feature that provides bincode-compatible implementations of serde serialization/deserialization to use with serde_as macro.

Example usage https://github.com/alloy-rs/alloy/blob/af593d2e725047aeccf79328f978faac8805a76c/crates/consensus/src/header.rs#L835-L846

shekhirin commented 1 day ago

why is this required for all the tx types?

they have a skip_serializing_if attribute, and we use tx types in the block body in Reth