Skip to content

Conversation

fkrause98
Copy link
Contributor

@fkrause98 fkrause98 commented Oct 17, 2024

Motivation

  • This endpoint is useful to poll events from contracts.

Description

@fkrause98 fkrause98 marked this pull request as ready for review October 22, 2024 21:37
@fkrause98 fkrause98 requested a review from a team as a code owner October 22, 2024 21:37
@@ -14,7 +14,7 @@ bytes.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
ethereum_rust-core.workspace = true
ethereum_rust-storage.workspace = true
ethereum_rust-storage = { path = "../../storage/store" }
Copy link
Collaborator

Choose a reason for hiding this comment

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

you have to do this in addition to adding it as dev dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -698,6 +698,22 @@ fn hash_key(key: &H256) -> Vec<u8> {
.to_vec()
}

// USED ONLY FOR TESTS.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would remove this from this PR and create a separate ticket to see if we want to tackle this.

It seems every crate has a different way of setting up a store for tests, and if we decide to create a helper to abstract this boilerplace, it should be done across the board.

I would keep this PR focused on the feature instead.

https://github.com/search?q=repo%3Alambdaclass%2Flambda_ethereum_rust+%22Store%3A%3Anew%22&type=code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But without this specific function; I cannot test the feature properly since I did not find a way to simulate the addition of blocks between RPC calls, how can I test it then? should I skip testing it for now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, I saw the test now. I would not add such a high level test here, it looks like a full fledged integration test.

Personally, I would just have unit tests inside the rust modules. If you have trouble testing the functionality, it may mean that you should move the business logic to a separate module (I think we discussed this at some point). For integration tests, we could leverage something like hive (we have our own fork) to write custom tests, or we could build or own framework.

Anyway, since these endpoints are not high priority right now, I would just eliminate that test, and create a ticket to work on this at some point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it may mean that you should move the business logic to a separate module (I think we discussed this at some point)

I can't remember if we did, but I'll keep in in mind for the future.

As per the PR:

@@ -19,7 +19,7 @@ use std::fmt::Debug;
use std::sync::Arc;
use tracing::info;

mod engines;
pub mod engines;
Copy link
Collaborator

Choose a reason for hiding this comment

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

revert this?

@@ -29,5 +29,6 @@ reqwest.workspace = true
[dev-dependencies]
hex-literal = "0.4.1"


Copy link
Collaborator

Choose a reason for hiding this comment

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

revert this plz

Copy link
Collaborator

@mpaulucci mpaulucci left a comment

Choose a reason for hiding this comment

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

good work!

@fkrause98 fkrause98 added this pull request to the merge queue Oct 24, 2024
Merged via the queue into main with commit 8ae4dfb Oct 24, 2024
11 checks passed
@fkrause98 fkrause98 deleted the get_filter_changes branch October 24, 2024 17:13
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
**Motivation**

- This endpoint is useful to poll events from contracts.


**Description**
- Moved filtering logic to a specific function under logs.rs
Closes lambdaclass#427 .
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.

Implement eth_getFilterChanges
2 participants