Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

net_plugin more quickly determine known block #6735

Merged
merged 5 commits into from
Feb 15, 2019
Merged

net_plugin more quickly determine known block #6735

merged 5 commits into from
Feb 15, 2019

Conversation

heifner
Copy link
Contributor

@heifner heifner commented Feb 13, 2019

Change Description

Consensus Changes

None

API Changes

None

Documentation Additions

None

@heifner heifner changed the title net_plugin exit early on known block net_plugin more quickly determine known block Feb 13, 2019
Copy link
Contributor

@brianjohnson5972 brianjohnson5972 left a comment

Choose a reason for hiding this comment

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

const comments are possible suggestions, but I feel more strongly about the assert unless you think it is an issue with backward compatibility

plugins/net_plugin/net_plugin.cpp Outdated Show resolved Hide resolved

char* header = reinterpret_cast<char*>(&payload_size);
size_t header_size = sizeof(payload_size);
char* header = reinterpret_cast<char*>(&payload_size); // avoid variable size encoding of uint32_t
Copy link
Contributor

Choose a reason for hiding this comment

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

If you want to be OCD like me you can make this "char* const " I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

plugins/net_plugin/net_plugin.cpp Outdated Show resolved Hide resolved
size_t header_size = sizeof(payload_size);
char* header = reinterpret_cast<char*>(&payload_size); // avoid variable size encoding of uint32_t
constexpr size_t header_size = sizeof(payload_size);
static_assert( header_size == message_header_size, "invalid message_header_size" );
size_t buffer_size = header_size + payload_size;
Copy link
Contributor

Choose a reason for hiding this comment

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

const

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

plugins/net_plugin/net_plugin.cpp Show resolved Hide resolved
@heifner heifner merged commit 7fc6b87 into develop Feb 15, 2019
@heifner heifner deleted the net-msg-opt branch February 15, 2019 16:27
baegjae added a commit to baegjae/eos that referenced this pull request May 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants