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

Introduce separate type for pending blocks #1170

Open
klkvr opened this issue Aug 21, 2024 · 2 comments
Open

Introduce separate type for pending blocks #1170

klkvr opened this issue Aug 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@klkvr
Copy link
Member

klkvr commented Aug 21, 2024

ref #1106 (comment)

Responses for pending blocks miss a bunch of fields, thus making it impossible to deserialize them without introducing many Options on RPC block types.

Possible solution could be to introduce a less restrictive type for pending blocks + separate methods for fetching those on Provider. After that we can disallow fetching pending blocks through provider.get_block_by_number, and use complete type for those responses.

@klkvr klkvr added the bug Something isn't working label Aug 21, 2024
@klkvr klkvr changed the title Intorduce separate type for pending blocks Introduce separate type for pending blocks Aug 21, 2024
@mattsse
Copy link
Member

mattsse commented Aug 22, 2024

After that we can disallow fetching pending blocks through provider.get_block_by_number, and use complete type for those responses.

this could be pretty invasive because then we'd need a new BlockNumberOrTag call.

what we could also do is just deserialize the pending block response differently, I'm fine with using default for the missing fields, not super great but simpler than introducing a block type just for pending.

@klkvr
Copy link
Member Author

klkvr commented Sep 8, 2024

what we could also do is just deserialize the pending block response differently

should we add a separate Network AT for pending block? like type PendingBlockResponse: RpcObject + Into<Self::BlockResponse>

and then in get_block_by_number deser as N::PendingBlockResponse if pending block is requested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants