Skip to content

txHandler: Use IP address instead of IP:port pair#6176

Merged
algorandskiy merged 14 commits intoalgorand:masterfrom
algorandskiy:pavel/erl-ip-addr
Feb 21, 2025
Merged

txHandler: Use IP address instead of IP:port pair#6176
algorandskiy merged 14 commits intoalgorand:masterfrom
algorandskiy:pavel/erl-ip-addr

Conversation

@algorandskiy
Copy link
Copy Markdown
Contributor

@algorandskiy algorandskiy commented Nov 20, 2024

Summary

Make ERL more strict by distinguishing IP addresses instead of connections.
Idea (basically as suggested in this comment: #6176 (comment))

  1. TxHandler how has erlClientMapper entity that maps sender's addresses to a meta peer erlIPClient.
  2. ERL gets the same erlIPClient for senders (connections) with the same address and it's logic not changed.
  3. erlIPClient tracks senders with the same address.
  4. erlIPClient sets own OnClose handlers so that when network actually closes a connection, this handler is called.
  5. When all connections closed (peers removed) the main OnClose called to notify ERL about this client termination.

Test Plan

  • A new erlIPClient unit test
  • ERL-counting/correctness test
  • Cluster performance test results
branch results
master relay summary: 8263.21 TPS, 3.12s/block, tx 56.4MB/s, rx 36.4MB/s, p2p tx 0.00B/s, p2p rx 0.00B/s
feature relay summary: 8316.12 TPS, 3.10s/block, tx 52.4MB/s, rx 33.8MB/s, p2p tx 0.00B/s, p2p rx 0.00B/s

Memory use remained the same but the test does not have thousands of clients to tell for sure.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.80%. Comparing base (1d93b27) to head (686aaed).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6176      +/-   ##
==========================================
+ Coverage   51.76%   51.80%   +0.04%     
==========================================
  Files         644      644              
  Lines       86506    86548      +42     
==========================================
+ Hits        44777    44840      +63     
+ Misses      38852    38842      -10     
+ Partials     2877     2866      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@algorandskiy algorandskiy requested review from cce and gmalouf November 20, 2024 13:47
Comment thread util/rateLimit.go Outdated
@algorandskiy algorandskiy marked this pull request as draft November 21, 2024 00:21
Comment thread data/txHandler.go
@algorandskiy algorandskiy requested a review from cce February 16, 2025 21:11
@algorandskiy algorandskiy marked this pull request as ready for review February 16, 2025 21:12
Comment thread data/txHandler.go Outdated
Comment thread data/txHandler.go
Comment thread data/txHandler.go
@algorandskiy algorandskiy requested review from cce and jannotti February 20, 2025 18:08
@algorandskiy
Copy link
Copy Markdown
Contributor Author

Remerged, fixed a possible race condition in closer

Comment thread data/txHandler.go Outdated
Co-authored-by: John Jannotti <jannotti@gmail.com>
Comment thread data/txHandler.go
algogm
algogm previously approved these changes Feb 21, 2025
@algogm algogm requested review from algogm and removed request for algogm February 21, 2025 21:41
@algogm algogm dismissed their stale review February 21, 2025 21:42

not in list

@algorandskiy algorandskiy changed the title ERL: Use IP address instead of IP:port pair txHandler: Use IP address instead of IP:port pair Feb 21, 2025
@algorandskiy algorandskiy merged commit 113b0c3 into algorand:master Feb 21, 2025
@algorandskiy algorandskiy deleted the pavel/erl-ip-addr branch March 16, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants