-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Report additional fields in validation stream #3865
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for adding the tests.
src/ripple/app/misc/NetworkOPs.cpp
Outdated
if (auto version = (*val)[~sfServerVersion]; version) | ||
jvObj[jss::server_version] = std::to_string(*version); | ||
|
||
if (auto cookie = (*val)[~sfCookie]; cookie) | ||
jvObj[jss::cookie] = std::to_string(*cookie); | ||
|
||
if (auto hash = (*val)[~sfValidatedHash]; hash) | ||
jvObj[jss::validated_hash] = strHex(*hash); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second check in all of these are redundant. In other words,
if(auto x = X(); x)
foo;
can be written as:
if(auto x = X())
foo;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ximinez, I believe I've addressed your comment with the most recent commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that was a human that called me today my bad bud
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
@miguelportilla, would you like to weigh in on this pull request? Or are you happy enough with reviews from @cjcobb23 and @ximinez? Whatever you'd like. Thanks. |
Private communications suggest that @miguelportilla is currently tied up with other matters. Given that we have approval from two reviewers, I'm going to squash this branch and, assuming it passes CI after the squash, mark it as passed. |
The HardenedValidations amendment introduces additional fields in validations: - `sfValidatedHash`, if present, is the hash the of last ledger that the validator considers to be fully validated. - `sfCookie`, if present, is a 64-bit cookie (the default implementation selects it randomly at startup but other implementations are possible), which can be used to improve the detection and classification of duplicate validations. - `sfServerVersion`, if present, reports the version of the software that the validator is running. By surfacing this information, server operators gain additional insight about variety of software on the network. If merged, this commit fixes XRPLF#3797 by adding the fields to the `validations` stream as shown below: - `sfValidateHash` as `validated_hash`: a 256-bit hex string; - `sfCookie` as `cookie`: a 64-bit integer as a string; and - `sfServerVersion` as `server_version`: a 64-bit integer as a string.
This branch was initially created by @nbougalis, who is currently too busy to shepherd the pull request through the review. So I'm re-opening the pull request in a form where I can easily handle any requests for changes.
Overview
The HardenedValidations amendment introduces additional fields in validations:
sfValidatedHash
, if present, is the hash the of last ledger that the validator considers to be fully validated.sfCookie
, if present, is a 64-bit cookie (the default implementation selects it randomly at startup but other implementations are possible), which can be used to improve the detection and classification of duplicate validations.sfServerVersion
, if present, reports the version of the software that the validator is running. By surfacing this information, server operators gain additional insight about variety of software on the network.If merged, this commit fixes #3797 by adding the fields to the
validations
stream as shown below:sfValidateHash
asvalidated_hash
: a 256-bit hex string;sfCookie
ascookie
: a 64-bit integer as a string; andsfServerVersion
asserver_version
: a 64-bit integer as a string.Type of Change
Tagging @wilsonianb who originally opened #3797.