iotex-core icon indicating copy to clipboard operation
iotex-core copied to clipboard

[p2p] Introduce batchWriter

Open Liuhaai opened this issue 3 years ago • 2 comments

Description

  1. Introduce batchManager module, which concatenates messages whose batchID are same.
  2. WithBatch() Option is added into xxxOutbound() interface in p2p module for batching outgoing messages
  3. Add protobuf concatenation test in action_deserializer_test.go
  4. Add iotexrpc.MessageType_ACTIONS and iotexrpc.MessageType_BLOCKS to support batching protobuf messages.

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [] Code refactor or improvement
  • [] Breaking change (fix or feature that would cause a new or changed behavior of existing functionality)
  • [] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [x] make test
  • [] fullsync
  • [] Other test (please specify)

Checklist:

  • [] My code follows the style guidelines of this project
  • [] I have performed a self-review of my code
  • [] I have commented my code, particularly in hard-to-understand areas
  • [] I have made corresponding changes to the documentation
  • [] My changes generate no new warnings
  • [] I have added tests that prove my fix is effective or that my feature works
  • [] New and existing unit tests pass locally with my changes
  • [] Any dependent changes have been merged and published in downstream modules

Liuhaai avatar Aug 03 '22 20:08 Liuhaai

Codecov Report

Merging #3581 (9a3dab4) into master (263ff82) will increase coverage by 0.76%. The diff coverage is 80.52%.

@@            Coverage Diff             @@
##           master    #3581      +/-   ##
==========================================
+ Coverage   74.47%   75.23%   +0.76%     
==========================================
  Files         269      300      +31     
  Lines       23925    25417    +1492     
==========================================
+ Hits        17818    19123    +1305     
- Misses       5174     5312     +138     
- Partials      933      982      +49     
Impacted Files Coverage Δ
action/actctx.go 90.62% <ø> (+6.25%) :arrow_up:
action/action.go 82.35% <ø> (ø)
action/action_deserializer.go 57.14% <ø> (ø)
action/candidate_update.go 88.88% <0.00%> (-4.14%) :arrow_down:
action/consignment_transfer.go 90.41% <ø> (ø)
action/const.go 100.00% <ø> (ø)
action/execution.go 83.78% <ø> (ø)
action/grantreward.go 68.57% <ø> (ø)
action/protocol/account/protocol.go 86.90% <ø> (ø)
action/protocol/dock.go 100.00% <ø> (ø)
... and 277 more

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

codecov[bot] avatar Aug 03 '22 21:08 codecov[bot]

@CoderZhi @dustinxie @millken plsl review

raullenchai avatar Aug 20 '22 15:08 raullenchai

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Jan 20 '23 19:01 sonarqubecloud[bot]