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

Dns peer feed no queue #3716

Merged
merged 16 commits into from
Jan 15, 2022
Merged

Dns peer feed no queue #3716

merged 16 commits into from
Jan 15, 2022

Conversation

tkstanczak
Copy link
Member

Fixes | Closes | Resolves #

Anything marked as optional that you didn't need to fill in, please remove it from the PR description. Choose one of the keywords above to refer to the issue this PR solves, followed by the issue number (e.g Fixes # 666). If there is no issue, remove the line. Remove this note after reading.

Changes:

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)

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...

src/Nethermind/Nethermind.Network.Stats/Model/Node.cs Outdated Show resolved Hide resolved
Comment on lines 90 to 92
string broken = nodeRecordText[4..].Replace("-", "+").Replace("_", "/");
broken = broken.PadRight(nodeRecordText.Length % 4);
RlpStream rlpStream = new(Convert.FromBase64String(broken));
Copy link
Member

Choose a reason for hiding this comment

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

This looks weird, also string manipulation can prrobably in place char span manipulation

Copy link
Member Author

Choose a reason for hiding this comment

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

impact on memory is minimal, measured it in dotmemory 16kb or so

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 PadRight doing what is expected here?

Copy link
Member

Choose a reason for hiding this comment

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

Moved it to a bit better implementation with StringBuilder, still not sure about PadRight

Copy link
Member

Choose a reason for hiding this comment

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

This needs tests to be added!

Copy link
Member

Choose a reason for hiding this comment

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

Fixed a lot of things but EnrDiscoveryTests fails to parse 1/6th of enr's

Comment on lines 320 to 323
// if (publicKeyOutput.Length < 64)
// {
// throw new ArgumentException($"{nameof(publicKeyOutput)} must be {64} bytes");
// }
Copy link
Member

@LukaszRozmej LukaszRozmej Dec 21, 2021

Choose a reason for hiding this comment

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

Is this safe?

Comment on lines 348 to 352
// int expectedInputLength = flags == Secp256K1EcCompressed ? 33 : 64;
// if (publicKey.Length != expectedInputLength)
// {
// throw new ArgumentException($"{nameof(publicKey)} must be {expectedInputLength} bytes");
// }
Copy link
Member

@LukaszRozmej LukaszRozmej Dec 21, 2021

Choose a reason for hiding this comment

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

Is this safe?

@LukaszRozmej LukaszRozmej merged commit 44babb9 into master Jan 15, 2022
@LukaszRozmej LukaszRozmej deleted the dnsPeerFeedNoQueue branch January 15, 2022 00:00
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.

2 participants