Skip to content

refactor: introduce p2p proto Envelope as a wrapper for p2p messages - #598

Merged
shotonoff merged 5 commits into
v0.11-devfrom
refactor-add-p2p-envelope
Mar 6, 2023
Merged

shotonoff merged 5 commits into
v0.11-devfrom
refactor-add-p2p-envelope

Conversation

@shotonoff

@shotonoff shotonoff commented Mar 3, 2023 •

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

The current implementation of p2p messaging doesn't include a wrapper message over the particular sent proto message. Thus, we cannot add any metadata to the message if necessary.

What was done?

  1. adds p2p.Envelope structure that we can use to wrap all possible p2p messages which send over p2p.
    Along with this, the module wrappers
  • blocksync.Message
  • statesync.Message
  • mempool.Message
  • p2p.PexMessage

consensus.Message is left because WAL mechanism uses it to write/read the consensus level messages

  1. p2p.Router is refactored to use Envelope Wrap/Unwrap methods rather than module's wrappers

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

lklimek
lklimek previously approved these changes Mar 6, 2023
Comment thread internal/p2p/router.go Resolved
@shotonoff
shotonoff merged commit 783d3f3 into v0.11-dev Mar 6, 2023
@shotonoff
shotonoff deleted the refactor-add-p2p-envelope branch March 6, 2023 17:47
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