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

[Feature] Make subscribe_blocks return header #1585

Closed
mattsse opened this issue Oct 30, 2024 · 0 comments · Fixed by #1586
Closed

[Feature] Make subscribe_blocks return header #1585

mattsse opened this issue Oct 30, 2024 · 0 comments · Fixed by #1586
Assignees
Labels
enhancement New feature or request

Comments

@mattsse
Copy link
Member

mattsse commented Oct 30, 2024

Component

rpc

Describe the feature you would like

currently:

) -> TransportResult<alloy_pubsub::Subscription<N::BlockResponse>> {

returns blocks, this is misleading because this subscription only emits headers.

this only works because all the fields are serde default:

/// Uncles' hashes.
#[cfg_attr(feature = "serde", serde(default))]
pub uncles: Vec<B256>,
/// Block Transactions. In the case of an uncle block, this field is not included in RPC
/// responses, and when deserialized, it will be set to [BlockTransactions::Uncle].
#[cfg_attr(
feature = "serde",
serde(
default = "BlockTransactions::uncle",
skip_serializing_if = "BlockTransactions::is_uncle"
)
)]
pub transactions: BlockTransactions<T>,
/// Withdrawals in the block.
#[cfg_attr(feature = "serde", serde(default, skip_serializing_if = "Option::is_none"))]
pub withdrawals: Option<Withdrawals>,

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants