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

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

Open
krisbitney opened this issue Dec 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@krisbitney
Copy link

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

@krisbitney krisbitney added the bug Something isn't working label Dec 3, 2024
@conr2d
Copy link
Contributor

conr2d commented Dec 26, 2024

On which binary is this issue found? With the Frontier template node, a 32-character hex string ID is returned as expected. If this issue occurs with your node implementation, please check whether this change has been properly applied to your code.

	// For Ethereum-compatible RPC.
-	config.rpc_id_provider = Some(Box::new(fc_rpc::EthereumSubIdProvider));
+	config.rpc.id_provider = Some(Box::new(fc_rpc::EthereumSubIdProvider));

	/* ... */

	let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
		config,
		client: client.clone(),
		backend: backend.clone(),
		task_manager: &mut task_manager,
		keystore: keystore_container.keystore(),
		transaction_pool: transaction_pool.clone(),
	});

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