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_newFilter / eth_getFilterChanges not working #2646

Closed
max-chechel-vc opened this issue Jul 1, 2024 · 0 comments · Fixed by #2668
Closed

eth_newFilter / eth_getFilterChanges not working #2646

max-chechel-vc opened this issue Jul 1, 2024 · 0 comments · Fixed by #2668
Assignees
Labels
bug Something isn't working
Milestone

Comments

@max-chechel-vc
Copy link

Description

There was a breaking change introduced in this PR

The problem is that whether shared cache is configured or not we try to write filter id to the shared cache:
https://github.com/hashgraph/hedera-json-rpc-relay/blob/main/packages/relay/src/lib/services/ethService/ethFilterService/index.ts#L94

But then we read the key from whatever cache is enabled:
https://github.com/hashgraph/hedera-json-rpc-relay/blob/main/packages/relay/src/lib/services/ethService/ethFilterService/index.ts#L212

As result if there's no shared cache set, this functionality doesn't work.

Steps to reproduce

  1. Set up Hedera JSON RPC relay so that Filters are enabled but there's no Redis cache set up
  2. Create filter:
curl -H "Content-Type: application/json" -X POST -d'{"method":"eth_newFilter","params":[{"topics":["0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822"],"address":["0x1e375f8947dffee57c7713f3176b01858bfba104"]}],"id":2,"jsonrpc":"2.0"}'  http://your-hedera-relay
  1. Try to request filter changes (while specifying the filter ID obtained on the previous step):
    curl -H "Content-Type: application/json" -X POST -d'{"method":"eth_getFilterChanges","params":[""],"id":4,"jsonrpc":"2.0"}' http://your-hedera-relay
  2. Receive an error:
{"error":{"code":-32001,"name":"Filter not found","message":"[Request ID: 063e3a42-c3ee-4579-a9d5-cac84cd07a42] Filter not found"},"jsonrpc":"2.0","id":4}

Additional context

No response

Hedera network

mainnet, testnet

Version

v0.50.1

Operating system

Linux

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
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants