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

Optimize parachain events handling #3216

Merged
merged 4 commits into from
Dec 23, 2024

Conversation

kziemianek
Copy link
Member

Iterate parachain's events only once and keep only events worker is interested in.

This should reduce time spent by event handler during parachain's event processing. It doesn't guarantee that sidechain block events will come out every 6 s.

@kziemianek kziemianek requested a review from a team December 22, 2024 18:33
Copy link

linear bot commented Dec 22, 2024

Copy link
Collaborator

@Kailai-Wang Kailai-Wang left a comment

Choose a reason for hiding this comment

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

Good catch, thanks!

Some small improvements that we could make:

  • we could define a collection of impl StaticEvent (to simplify the code) and match any of them in `FilterableEvents::new() - it should have better readability and maintainability
  • we could clean-up the interested events a bit - e.g. we don't actually care about ParentchainBlockProcessed events - but including them in the interested events would actually push them into the post-processing including merkle root calculation

@Kailai-Wang Kailai-Wang merged commit 6b179a2 into dev Dec 23, 2024
22 checks passed
@Kailai-Wang Kailai-Wang deleted the p-1248-sidechain-block-production-takes-to-long branch December 23, 2024 19:35
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.

2 participants