-
Notifications
You must be signed in to change notification settings - Fork 236
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(consensus): bincode compatibility for header and transaction types #1397
Conversation
8f47037
to
af593d2
Compare
@@ -64,3 +67,4 @@ serde = [ | |||
"dep:alloy-serde", | |||
"alloy-eips/serde", | |||
] | |||
serde-bincode-compat = ["serde_with"] |
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.
open to renaming this feature to something more generic than bincode, because it also unlocks messagepack via https://github.com/3Hren/msgpack-rust
484416c
to
84956fe
Compare
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.
why is this required for all the tx types?
they have a |
## Motivation alloy-rs/alloy#1349 ## Solution Same as alloy-rs/alloy#1397 ## PR Checklist - [x] Added Tests - [x] Added Documentation - [ ] Breaking changes
…es (alloy-rs#1397) * fix(serde): encode optional quantity as Some * use serialize_some * fix in other types too * feat(consensus): bincode compatibility for header and transaction types * add docs * reorganize modules * add legacy bincode compat impl, remove comments * less cows * fix doctest for legacy tx * rename feature * more info about limitation * remove special treatment for quantity fields
Closes #1349
Introduces the
serde-bincode-compat
feature that provides bincode-compatible implementations of serde serialization/deserialization to use withserde_as
macro.Example usage
alloy/crates/consensus/src/header.rs
Lines 835 to 846 in af593d2