Skip to content

Conversation

@LeoPatOZ
Copy link
Collaborator

@LeoPatOZ LeoPatOZ commented Sep 11, 2025

Solves #9

@LeoPatOZ LeoPatOZ requested a review from 0xNeshi September 11, 2025 20:58
Base automatically changed from channels to main September 12, 2025 06:43
@LeoPatOZ LeoPatOZ marked this pull request as ready for review September 12, 2025 08:44
Copy link
Collaborator

@0xNeshi 0xNeshi left a comment

Choose a reason for hiding this comment

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

PR looks good, but will approve once PR #15 is merged in after review the full PR.

to_block: u64,
event_channels: &HashMap<String, mpsc::Sender<Log>>,
) -> anyhow::Result<()> {
for event_filter in &self.tracked_events {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can each of event process be done in parallel?

If you're not sure, feel free to just create an issue to track parallel processing feature, we can handle that later

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe this is what this is achieving. The basic flow is:

  1. Create a mapping between event --> channel
  2. Create background process per event.
  3. Blocks are processed as a single thread, the events are sent to their resepcitve channels / threads
  4. Each thread independently calls their respective callbacks

Copy link
Collaborator

@0xNeshi 0xNeshi Sep 17, 2025

Choose a reason for hiding this comment

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

Blocks are processed as a single thread, the events are sent to their resepcitve channels / threads

Isn't this function fetching events separately for each event filter? Meaning, if you have 3 event filters, it would invoke 3 different fetch requests for the same block range?

Copy link
Collaborator

@0xNeshi 0xNeshi left a comment

Choose a reason for hiding this comment

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

Approving in advance, the remaining open discussion can continue despite merging.

If a change becomes necessary, we should create an issue and address it in a separate PR.

@0xNeshi 0xNeshi merged commit 5c4be1b into main Sep 17, 2025
6 checks passed
@0xNeshi 0xNeshi deleted the event-channeling branch September 17, 2025 10:00
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.

3 participants