Skip to content

[Bug] safeHeadResponse fails to parse op-node RPC response #155

@ratankaliani

Description

@ratankaliani

Component

rpc

What version of Alloy are you on?

0.3.3

Operating System

None

Describe the bug

Hey! op-alloy-rpc-types on 0.3.3 fails to parse optimism_safeHeadAtL1Block from op-node.

result error: unknown field `hash`, expected one of `blockNumber`, `blockHash`, `requireCanonical`

The BlockId struct used in SafeHeadResponse doesn't match the output of optimism_safeHeadAtL1Block which is:

{"l1Block":{"hash":"0x7de331305c2bb3e5642a2adcb9c003cc67cefc7b05a3da5a6a4b12cf3af15407","number":6834391},"safeHead":{"hash":"0xa5e5ec1ade7d6fef209f73861bf0080950cde74c4b0c07823983eb5225e282a8","number":18266679}}

Is there any testing that these types are correct against an OP node? If not, we should add testing so that bad types are not pushed.

I'll look into putting up a fix for this today/tomorrow, should be pretty small.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions