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

feat: multicast #728

Open
wants to merge 6 commits into
base: feat-p2p-mtm
Choose a base branch
from
Open

feat: multicast #728

wants to merge 6 commits into from

Conversation

arkadiuszos4chain
Copy link
Collaborator

@arkadiuszos4chain arkadiuszos4chain commented Dec 19, 2024

Description of Changes

Add Hybrid Blockchain Communication Using Multicast Groups

Key Changes

1. Hybrid Communication Mode

  • Introduced a new communication method called hybrid, which combines p2p communication with a multicast group-based mechanism.
  • Services can now switch between classic (current approch with p2p connection only) and hybrid communication modes,

2. Transparent Integration for Services

  • The communication method is abstracted from the services, ensuring seamless integration without requiring modifications to service logic when communication mode is changed.
  • To achieve this, mediating structures, such as a mediator in metamorph, were implemented to handle message translation and routing between p2p and multicast groups.

3. New Structures and Improvements

  • Designed and implemented the multicast communication logic, including message handling and group management.
  • Enhanced modularity and maintainability by encapsulating the communication logic in dedicated components.

Benefits

  • Flexibility: Provides a flexible and future-proof communication layer that can adapt to different blockchain network configurations.
  • Backward Compatibility: Transparent integration ensures compatibility with existing p2p setups.

Linked Issues / Tickets

Reference any related issues or tickets, e.g. "Closes #123".

Testing Procedure

Describe the tests you've added or any testing steps you've taken.

  • I have added new unit tests
  • All tests pass locally
  • I have tested manually in my local environment

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have updated CHANGELOG.md with my changes

@arkadiuszos4chain arkadiuszos4chain self-assigned this Dec 19, 2024
@arkadiuszos4chain arkadiuszos4chain marked this pull request as ready for review December 20, 2024 09:06
internal/blocktx/bcnet/mcast/listner.go Outdated Show resolved Hide resolved
MaxAllowedBlockHeightMismatch int `mapstructure:"maxAllowedBlockHeightMismatch"`
MessageQueue *MessageQueueConfig `mapstructure:"mq"`
P2pReadBufferSize int `mapstructure:"p2pReadBufferSize"`
BlockchainNetwork *BlockchainNetwork[*BlocktxGroups] `mapstructure:"bcnet"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is unnecessarily complicated. You could just create 2 structs, such as BlocktxMcast and MetamorphMcast or something like that. Would be easier to use it later in code as well. But it's just my opinion :)

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
54.2% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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