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

fix(comms): only permit a single inbound messaging substream per peer #5731

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Sep 4, 2023

Description

Only permit a single inbound messaging session per peer
Only emit MessageReceived event in tests
Ban peer if they exceed the frame size

Motivation and Context

A node may initiate boundless inbound messaging sessions. This PR limits the number of sessions to one. Tari nodes only initiate a single session as needed so this shouldn't have any effect on non-malicious nodes.

MessageReceived events would be generated for each message received. This was only used in tests. Since these events aren't read in non-test contexts and because it can be very busy, this PR disables them by default and only enables in tests. This does not affect the message count in the minotari node status line.

How Has This Been Tested?

New unit test that checks sessions are closed as long as the first one is active.

What process can a PR reviewer use to test or verify this change?

Messaging still works as expected (ping-peer, discover-peer etc)

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels Sep 4, 2023
@github-actions
Copy link

github-actions bot commented Sep 4, 2023

Test Results (CI)

1 198 tests   1 198 ✔️  9m 32s ⏱️
     38 suites         0 💤
       1 files           0

Results for commit 0cb6358.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

Test Results (Integration tests)

27 tests   27 ✔️  12m 48s ⏱️
11 suites    0 💤
  2 files      0

Results for commit 0cb6358.

♻️ This comment has been updated with latest results.

@ghpbot-tari-project ghpbot-tari-project removed the P-reviews_required Process - Requires a review from a lead maintainer to be merged label Sep 4, 2023
@SWvheerden SWvheerden merged commit c91a35f into tari-project:development Sep 4, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-acks_required Process - Requires more ACKs or utACKs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants