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

Bincode support for ExExNotification #11170

Closed
shekhirin opened this issue Sep 24, 2024 · 0 comments · Fixed by #11331
Closed

Bincode support for ExExNotification #11170

shekhirin opened this issue Sep 24, 2024 · 0 comments · Fixed by #11331
Assignees
Labels
A-exex Execution Extensions A-sdk Related to reth's use as a library C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started

Comments

@shekhirin
Copy link
Collaborator

shekhirin commented Sep 24, 2024

Describe the feature

Blocked by alloy-rs/alloy#1349

Problem

Alloy has a bunch of structs that use #[serde(skip*)] attributes. This attributes isn't supported in bincode, as well as in rmp-serde.

Unfortunately, It means that we cannot serialize/deserialize ExExNotification using these formats.

Solution

Introduce helper serde modules for those structs that are downstream from ExExNotification and have #[serde(skip*)] attributes on fields and remove those attributes. Modules should be similar to https://github.com/alloy-rs/alloy/blob/5c7470c113df23a625456413bdf8c87e0b7438bc/crates/rpc-types-beacon/src/payload.rs#L275-L298

Then, these modules should be used in structs that have problematic types as fields. For example, for the Block type we will need to use a #[serde_as] on the Block struct and #[serde_as(as = "HeaderBincode")] on the header field

pub struct Block {
/// Block header.
#[deref]
pub header: Header,

Both of the attributes should be gated by the serde-bincode feature.

The types that need special handling are:

  • ExExNotification
  • Chain
  • SealedBlockWithSenders
  • SealedBlock
  • SealedHeader
  • BlockBody
  • TransactionSigned
  • Transaction

As a test, we should be able to serialize and deserialize the ExExNotification struct using bincode.

Additional context

No response

@shekhirin shekhirin added C-enhancement New feature or request A-sdk Related to reth's use as a library A-exex Execution Extensions labels Sep 24, 2024
@shekhirin shekhirin added the D-good-first-issue Nice and easy! A great choice to get started label Sep 24, 2024
@shekhirin shekhirin self-assigned this Sep 30, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-exex Execution Extensions A-sdk Related to reth's use as a library C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant