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

[Consensus] Make interaction among pacemaker and consensus modules asynchronous #428

Open
7 tasks
gokutheengineer opened this issue Jan 5, 2023 · 1 comment
Assignees
Labels
code health Nice to have code improvement consensus Consensus specific changes

Comments

@gokutheengineer
Copy link
Contributor

gokutheengineer commented Jan 5, 2023

Objective

Issue #395 explains necessity of separation of the consensus and pacemaker modules. We can identify two categories on how to do it:

  1. Synchronously: Via calling functions of the consensus module from the pacemaker module. Since we shouldn't use reflect in the production code (except for testing), we need to expose necessary functions of the consensus module. PR [Consensus] Decoupling the Pacemaker and Consensus modules (Synchronous method) #427 follows this methodology.
  2. Asynchronously: Using an event bus to define and send events from pacemaker module to consensus module. This methodology will be more idiomatic than what is implemented in PR [Consensus] Decoupling the Pacemaker and Consensus modules (Synchronous method) #427, since it exposes functions that are internal to the consensus module in shared module. We must seek a way to avoid doing this, and build asynchronous interaction.

Origin Document

I tried to implement asynchronous version first and faced the following problem:

event bus problem

The WIP I made on asynchronous implementation can be found in this branch: https://github.com/pokt-network/pocket/tree/issue/395-WIP-async-decouple-consensus-and-pacemaker-modules

Goals

  • Asynchronous interaction between pacemaker and consensus modules

Deliverable

  • Implement event bus, or use the existing one for interaction between pacemaker and consensus modules.

Non-goals / Non-deliverables

  • Adding sleep statements
  • Using reflect

General issue deliverables

  • Update the appropriate CHANGELOG(s)
  • Update any relevant local/global README(s)
  • Update relevant source code tree explanations
  • Add or update any relevant or supporting mermaid diagrams

Testing Methodology

  • All tests: make test_all
  • LocalNet: verify a LocalNet is still functioning correctly by following the instructions at docs/development/README.md

Creator: @gokutheengineer
Co-owner: @Olshansk

@Olshansk
Copy link
Member

Olshansk commented Jan 5, 2023

LGTM, thanks for creating the ticket @gokutheengineer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code health Nice to have code improvement consensus Consensus specific changes
Projects
Status: Backlog
Development

No branches or pull requests

3 participants