Include validator's master public key in validation stream:

The validation stream only reported the ephemeral signing key for validators
which use manifests. This made tracking unnecessarily difficult for clients
processing the data stream.

With this change, the validator's long-term master public key is also
included.

This commit fixes #3005

* Provide proposing validator's master key in the validation stream
  subscription JSON responses.

Implement code review changes.

FIXES: #3005
This commit is contained in:
Devon White
2019-09-24 21:33:42 -04:00
committed by Manoj doshi
parent b53fda1e1a
commit 9196d9541a
2 changed files with 9 additions and 2 deletions

View File

@@ -1721,16 +1721,23 @@ void NetworkOPsImp::pubValidation (STValidation::ref val)
{
Json::Value jvObj (Json::objectValue);
auto const signerPublic = val->getSignerPublic();
jvObj [jss::type] = "validationReceived";
jvObj [jss::validation_public_key] = toBase58(
TokenType::NodePublic,
val->getSignerPublic());
signerPublic);
jvObj [jss::ledger_hash] = to_string (val->getLedgerHash ());
jvObj [jss::signature] = strHex (val->getSignature ());
jvObj [jss::full] = val->isFull();
jvObj [jss::flags] = val->getFlags();
jvObj [jss::signing_time] = *(*val)[~sfSigningTime];
auto const masterKey = app_.validatorManifests().getMasterKey(signerPublic);
if(masterKey != signerPublic)
jvObj [jss::master_key] = toBase58(TokenType::NodePublic, masterKey);
if (auto const seq = (*val)[~sfLedgerSequence])
jvObj [jss::ledger_index] = to_string (*seq);