Skip to content

eth_subscribe RPC method returns 16-character subscription ID instead of 32-byte ID #1544

@krisbitney

Description

@krisbitney

Description

Recently, there was a change to the behavior of eth_subscribe. It is now returning a 16-character subscription ID (e.g. TlCPBeW4fku7BlSo) instead of a 32-byte ID.

I believe the changes in this PR may be related: #1504

Steps to Reproduce

        const result = (await client.transport.request({
          method: "eth_subscribe",
          params: ["newHeads"],
        })) as any

Expected vs. Actual Behavior

The expected behavior would be to receive a 32-byte hex string representing the subscription ID. The actual received value is a 16-character string, which presumably is a UTF-8 encoded representation of the 32-byte ID.

Environment

TypeScript with Viem

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions