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

Refactor/generic send request #4717

Merged
merged 3 commits into from
Oct 9, 2022
Merged

Conversation

asdacap
Copy link
Contributor

@asdacap asdacap commented Oct 6, 2022

Refactor as mentioned by the attribute.

Changes:

  • Remove duplicated pattern on send request.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests??

  • Yes
  • No

Comments about testing , should you have some (optional)

Goerli can sync to head.

Further comments (optional)

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@asdacap asdacap marked this pull request as ready for review October 6, 2022 14:31
@asdacap asdacap requested a review from marcindsobczak October 6, 2022 14:31
Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

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

Sidenote we need to drop MessageQueue and use eth66 req/resp mapping

_bodiesRequests,
message,
TransferSpeedType.Bodies,
static (message) => $"{nameof(GetBlockBodiesMessage)} with {message.BlockHashes.Count} block hashes",
Copy link
Member

Choose a reason for hiding this comment

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

Is the string computed as a constant on compile?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dont think so, it only prevent allocation from the lambda.

@asdacap
Copy link
Contributor Author

asdacap commented Oct 7, 2022

What is that?

@marcindsobczak
Copy link
Contributor

What is that?

#4714

@asdacap asdacap merged commit 81bfbf1 into master Oct 9, 2022
@asdacap asdacap deleted the refactor/generic-send-request branch October 9, 2022 01:35
rubo pushed a commit that referenced this pull request Oct 13, 2022
* Generic send request

* Fix wrong transfer speed

* Micro optimization
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.

3 participants