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

Improve P2P transaction handling #2755

Merged
merged 2 commits into from
Oct 21, 2022
Merged

Improve P2P transaction handling #2755

merged 2 commits into from
Oct 21, 2022

Conversation

roman-khimov
Copy link
Member

cpu_four_(30_wrk,_64K_pool)
cpu_seven_(30_wrk,_64K_pool)
mem_four_(30_wrk,_64K_pool)
mem_seven_(30_wrk,_64K_pool)
ms_per_block_four_(30_wrk,_64K_pool)
ms_per_block_seven_(30_wrk,_64K_pool)
tpb_four_(30_wrk,_64K_pool)
tpb_seven_(30_wrk,_64K_pool)
tps_four_(30_wrk,_64K_pool)
netw
tps_seven_(30_wrk,_64K_pool)

Microoptimization, we can do this because we only use them in handleInvCmd().
@roman-khimov roman-khimov added network P2P layer performance More of something per second labels Oct 21, 2022
@roman-khimov roman-khimov added this to the v0.99.5 milestone Oct 21, 2022
@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

Merging #2755 (12b9076) into master (0f625f0) will increase coverage by 0.08%.
The diff coverage is 84.09%.

❗ Current head 12b9076 differs from pull request most recent head e1b5ac9. Consider uploading reports for the commit e1b5ac9 to get more accurate results

@@            Coverage Diff             @@
##           master    #2755      +/-   ##
==========================================
+ Coverage   85.23%   85.31%   +0.08%     
==========================================
  Files         324      324              
  Lines       40118    40150      +32     
==========================================
+ Hits        34194    34254      +60     
+ Misses       4554     4523      -31     
- Partials     1370     1373       +3     
Impacted Files Coverage Δ
pkg/network/server.go 73.06% <84.09%> (+<0.01%) ⬆️
pkg/network/compress.go 64.00% <0.00%> (-12.00%) ⬇️
pkg/core/blockchain.go 81.20% <0.00%> (+0.05%) ⬆️
pkg/consensus/consensus.go 73.75% <0.00%> (+0.11%) ⬆️
pkg/core/transaction/transaction.go 86.66% <0.00%> (+1.48%) ⬆️
pkg/network/message.go 94.77% <0.00%> (+2.23%) ⬆️
pkg/services/oracle/request.go 63.18% <0.00%> (+5.00%) ⬆️
pkg/services/oracle/oracle.go 87.59% <0.00%> (+14.59%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

This allows to naturally scale transaction processing if we have some peer
that is sending a lot of them while others are mostly silent. It also can help
somewhat in the event we have 50 peers that all send transactions. 4+1
scenario benefits a lot from it, while 7+2 slows down a little. Delayed
scenarios don't care.

Surprisingly, this also makes disconnects (#2744) much more rare, 4-node
scenario almost never sees it now. Most probably this is the case where peers
affect each other a lot, single-threaded transaction receiver can be slow
enough to trigger some timeout in getdata handler of its peer (because it
tries to push a number of replies).
Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

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

Tests need to be fixed.

@roman-khimov
Copy link
Member Author

Tests need to be fixed.

Yep, already done.

@roman-khimov roman-khimov merged commit bf4636f into master Oct 21, 2022
@roman-khimov roman-khimov deleted the improve-networking branch October 21, 2022 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
network P2P layer performance More of something per second
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants