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

[bug] eth_getFilterChanges only supports log return type #447

Open
eshaan7 opened this issue Nov 23, 2024 · 1 comment · May be fixed by #448
Open

[bug] eth_getFilterChanges only supports log return type #447

eshaan7 opened this issue Nov 23, 2024 · 1 comment · May be fixed by #448

Comments

@eshaan7
Copy link
Contributor

eshaan7 commented Nov 23, 2024

From alloy-rpc-types:

pub enum FilterChanges<T = Transaction> {
    /// Empty result.
    #[serde(with = "empty_array")]
    #[default]
    Empty,
    /// New logs.
    Logs(Vec<RpcLog>),
    /// New hashes (block or transactions).
    Hashes(Vec<B256>),
    /// New transactions.
    Transactions(Vec<T>),
}

The eth_getFilterChanges can return either of the 3 types but the current code only handles Vec<Log>. So if I pass a filter ID returned from eth_newBlockFilter or eth_newPendingTransactionFilter to Helios' eth_getFilterChanges then I get the following error:

{
    "jsonrpc": "2.0",
    "error": {
        "code": 1,
        "message": "rpc error on method: get_filter_changes, message: deserialization error: invalid type: string \"0x34bd63ac759af80513e814a47bb4419ed8b8fff5f84730a0a704f3d3418b77f8\", expected struct Log at line 1 column 69"
    },
    "id": "14"
}
@eshaan7 eshaan7 linked a pull request Nov 25, 2024 that will close this issue
@ncitron
Copy link
Collaborator

ncitron commented Nov 25, 2024

Yeah we should support all the different kinds of filters.

eshaan7 added a commit to eshaan7/helios that referenced this issue Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants