Skip to content

feat(core): add uninstall filter to cli #3224

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sfroment
Copy link

@sfroment sfroment commented Jun 19, 2025

Motivation
Make the cli more complete

Description

simply add the call to uninstall filter

Closes #issue_number

Quick Q which scope shall I use ?

@Copilot Copilot AI review requested due to automatic review settings June 19, 2025 09:46
@sfroment sfroment requested a review from a team as a code owner June 19, 2025 09:46
@sfroment sfroment force-pushed the dev/sfroment/add-uninstall-filter branch from c7a1ab5 to a1bcb32 Compare June 19, 2025 09:47
@sfroment sfroment changed the title feat(networking): add uninstall filter to cli feat: add uninstall filter to cli Jun 19, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Introduces an uninstall_filter method to the Ethereum RPC client for completeness and adds corresponding error handling types.

  • Adds uninstall_filter RPC call in EthClient
  • Defines UninstallFilterError enum and integrates it into EthClientError
  • Updates imports to include the new error type

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
crates/networking/rpc/clients/eth/mod.rs Added uninstall_filter method
crates/networking/rpc/clients/eth/errors.rs Introduced UninstallFilterError enum and updated EthClientError
Comments suppressed due to low confidence (3)

crates/networking/rpc/clients/eth/mod.rs:1264

  • Wrapping the filter ID inside a JSON string may not match the RPC spec if a numeric parameter is expected; verify whether eth_uninstallFilter requires a hex string or raw number and adjust accordingly.
            params: Some(vec![json!(format!("{filter_id:#x}"))]),

crates/networking/rpc/clients/eth/mod.rs:1259

  • [nitpick] Public methods should include a doc comment describing the purpose, parameters, and return value for clarity in the public API.
    pub async fn uninstall_filter(&self, filter_id: u64) -> Result<bool, EthClientError> {

crates/networking/rpc/clients/eth/mod.rs:1259

  • I don’t see any unit tests covering this new method; please add tests for both the success path and error scenarios.
    pub async fn uninstall_filter(&self, filter_id: u64) -> Result<bool, EthClientError> {

Comment on lines +1260 to +1261
let request = RpcRequest {
id: RpcRequestId::Number(1),
Copy link
Preview

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a hardcoded request ID of 1 may cause collisions when multiple requests are in flight; consider generating a unique ID per call or using a shared atomic counter.

Suggested change
let request = RpcRequest {
id: RpcRequestId::Number(1),
let unique_id = self.request_id_counter.fetch_add(1, Ordering::SeqCst);
let request = RpcRequest {
id: RpcRequestId::Number(unique_id),

Copilot uses AI. Check for mistakes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dunno

@sfroment sfroment changed the title feat: add uninstall filter to cli feat(levm): add uninstall filter to cli Jun 19, 2025
@sfroment sfroment changed the title feat(levm): add uninstall filter to cli feat(core): add uninstall filter to cli Jun 19, 2025
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 this pull request may close these issues.

1 participant