alloy-rs / alloy

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

[Feature] Make subscribe_blocks return header #1585

Closed mattsse closed 3 weeks ago

mattsse commented 3 weeks ago

Component

rpc

Describe the feature you would like

currently:

https://github.com/alloy-rs/alloy/blob/b227b17ac08f966be3459c1776bb450d15612fcb/crates/provider/src/provider/trait.rs#L802-L802

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

this only works because all the fields are serde default:

https://github.com/alloy-rs/alloy/blob/b227b17ac08f966be3459c1776bb450d15612fcb/crates/rpc-types-eth/src/block.rs#L25-L40

Additional context

No response