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] Catch all for extra data in block headers #18

Closed
onbjerg opened this issue Nov 3, 2023 · 2 comments
Closed

[Feature] Catch all for extra data in block headers #18

onbjerg opened this issue Nov 3, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@onbjerg
Copy link
Contributor

onbjerg commented Nov 3, 2023

Component

No response

Describe the feature you would like

Foundry has some special handling for some L2s (e.g. Arbitrum), and we use a catch all/fallback field in the block header to look up extra properties on these L2s. This is both used in the forking backend (here) and in Cast (to show all fields in e.g. cast block)

Additional context

No response

@onbjerg onbjerg added the enhancement New feature or request label Nov 3, 2023
@prestwich
Copy link
Member

prestwich commented Nov 29, 2023

is it sufficient to do something like

struct WithExtraData<T> { 
    #[serde(flatten)]
    inner: T,
    #[serde(flatten)]
    extra: HashMap<String, Value>,
}

@DaniPopes
Copy link
Member

RPC types Block has an other: OtherFields field:

pub other: OtherFields,

I believe this is done now.

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

No branches or pull requests

3 participants