Skip to content

feat: add #[serde(default)] to accessList field in TxEip4844 #2477

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davidp94
Copy link

Motivation

When deserializing EIP-4844 transactions, the accessList field may be missing from some sources or networks. Without a default, deserialization fails if the field is absent, even though an empty access list is a valid default per the spec. This causes compatibility issues, especially when working with networks or tooling that omit this field.

Solution

This PR adds #[serde(default)] to the accessList field in the TxEip4844 struct. This ensures that if the field is missing during deserialization, it will default to an empty access list, improving compatibility and robustness. No breaking changes are introduced, and this aligns with how similar fields are handled in other transaction types.


You can copy and paste this into your PR description. If you want to check the box for tests or documentation, you can do so as appropriate for your changes. Let me know if you want to add more details or context!

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does missing mean null or actually missing?

do you have reference data for this that we can add as test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants