Skip to content

Handle gossip messages asynchronously - #5316

Merged
twoeths merged 2 commits into
tuyen/new_gossip_queuesfrom
tuyen/async_handle_gossip_messages
Mar 31, 2023
Merged

Handle gossip messages asynchronously#5316
twoeths merged 2 commits into
tuyen/new_gossip_queuesfrom
tuyen/async_handle_gossip_messages

Conversation

@twoeths

@twoeths twoeths commented Mar 29, 2023

Copy link
Copy Markdown
Member

Motivation

  • There are I/O lag issue with the new gossip queue: more time to submit attestations from vc, more time to call notifyNewPayload engine api
  • Lifecycle of a gossipsub message is all synchronous:
    • we call onGossipsubMessage synchronously
    • which call gossip validation function synchronously
    • which call the reportMessageValidationResult synchronously
    • this is really bad for the I/O in case RPC contains thousands of gossip messages
  • In current implementation (stable/unstable) when we push gossip messages to JobItemQueue we always use setTimeout() which helps avoid the I/O lag issue, we also yield to the macro queue every 50ms there

Description

  • Use setTimeout to break our gossip handler to multiple event loops which helps the I/O lag issue (which make it equivalent to the current behavior of stable branch)
  • Metrics show that it does not effect performance at all: almost same job wait time, job process time, no dropped job

part of #5247

@twoeths
twoeths marked this pull request as ready for review March 29, 2023 03:53
@twoeths
twoeths requested a review from a team as a code owner March 29, 2023 03:53
@twoeths
twoeths merged commit d0eb95a into tuyen/new_gossip_queues Mar 31, 2023
@twoeths
twoeths deleted the tuyen/async_handle_gossip_messages branch March 31, 2023 06:07
twoeths added a commit that referenced this pull request Apr 7, 2023
* Handle gossip messages async

* Add comments
wemeetagain pushed a commit that referenced this pull request Apr 7, 2023
* Handle gossip messages async

* Add comments
@wemeetagain

Copy link
Copy Markdown
Member

馃帀 This PR is included in v1.8.0 馃帀

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