-
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
Add validator list RPC calls (RIPD-1541) #2242
Conversation
@HowardHinnant, I took some of your chrono changes in #2237 for use cdc7537 |
|
||
} // namespace test | ||
} // namespace ripple | ||
#endif |
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.
No newline at end of file
std::forward_as_tuple(local), | ||
std::forward_as_tuple()); | ||
// Config listed keys never expire | ||
if (it.second) |
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.
#UnIndent2x
src/test/rpc/ValidatorRPC_test.cpp
Outdated
expiration, | ||
1, | ||
keys); | ||
env.app().validatorSites().start(); |
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.
I'm getting the same test failures as Travis:
#32 failed: ValidatorRPC_test.cpp(269)
#33 failed: ValidatorRPC_test.cpp(273)
#34 failed: ValidatorRPC_test.cpp(275)
#35 failed: ValidatorRPC_test.cpp(277)
#37 failed: ValidatorRPC_test.cpp(290)
#38 failed: ValidatorRPC_test.cpp(291)
#39 failed: ValidatorRPC_test.cpp(301)
#41 failed: ValidatorRPC_test.cpp(304)
#45 failed: ValidatorRPC_test.cpp(314)
#46 failed: ValidatorRPC_test.cpp(317)
The site isn't being fetched here because ValidatorSite::start
was already called when env
was constructed.
The only workaround I've thought of is to use a new Env
for this set of tests (and construct it after the site is up).
Codecov Report
@@ Coverage Diff @@
## develop #2242 +/- ##
==========================================
+ Coverage 70.11% 70.2% +0.09%
==========================================
Files 689 691 +2
Lines 50800 50890 +90
==========================================
+ Hits 35617 35726 +109
+ Misses 15183 15164 -19
Continue to review full report at Codecov.
|
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.
I'd like to see the hardcoded test port changed ...otherwise looks good to me
src/test/rpc/ValidatorRPC_test.cpp
Outdated
#include <test/jtx.h> | ||
#include <test/jtx/TrustedPublisherServer.h> | ||
|
||
#include <boost/format.hpp> |
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.
I don't see any evidence that this header is used...I might be missing something
src/test/rpc/ValidatorRPC_test.cpp
Outdated
|
||
public: | ||
void | ||
testPriviledges() |
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.
to be super nit-picky, this is mispelled (no 'd' in privilege) BUT I would not change unless you are messing the the code for some other reason.
http_sync_server server1( | ||
ep1, ioService, pubSigningKeys1, manifest1, sequence, | ||
expiration.time_since_epoch().count(), version, list1); | ||
TrustedPublisherServer server1( |
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.
ioService
(line 116) is now unused, FWIW
src/test/rpc/ValidatorRPC_test.cpp
Outdated
expectedKeys.insert(toStr(key)); | ||
|
||
// Publisher site information | ||
std::uint16_t constexpr port = 7475; |
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.
for tests particularly, I would opt for OS port selection - it helps avoids spurious failures related to ports in use. You can use port 0
in for the bind endpoint and then provide a way on TrustedPublisherServer
to get acceptor_.local_endpoint()
after listen
has been called, which you then pass to clients (probably the simplest approach is just make acceptor_
public).
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.
👍
} | ||
} | ||
|
||
// Current validator keys |
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.
This seems redundant since it's always accompanied by the individual published lists from above.
What if we instead just list the trusted keys (from trustedKeys_
)?
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.
Agreed, that makes a lot more sense.
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.
Call the JSON field validator_keys
or trusted_validator_keys
?
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.
I like trusted_validator_keys
better
@@ -231,6 +232,9 @@ ValidatorSite::onSiteFetch( | |||
body["signature"].asString(), | |||
body["version"].asUInt()); | |||
|
|||
sites_[siteIdx].lastRefreshStatus.emplace( | |||
Site::Status{clock_type::now(), disp}); |
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.
I think lastRefreshStatus
should also be updated with ListDisposition::invalid
in the else
below in the case that we fail to parse the JSON.
src/ripple/protocol/JsonFields.h
Outdated
JSS ( url ); // in/out: Subscribe, Unsubscribe | ||
JSS ( url_password ); // in: Subscribe | ||
JSS ( url_username ); // in: Subscribe | ||
JSS ( urlgravatar ); // | ||
JSS ( username ); // in: Subscribe | ||
JSS ( validated ); // out: NetworkOPs, RPCHelpers, AccountTx* | ||
// Tx | ||
JSS ( validator_list_expires) ; // out: NetworkOps |
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.
also in ValidatorList
Json::Value | ||
doValidatorLists(RPC::Context& context) | ||
{ | ||
auto lock = make_lock(context.app.getMasterMutex()); |
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.
Do we need the lock? (Same with ValidatorSites
handler)
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.
Good catch. I was just following other RPCs, but since the getJson
calls are themselves safe, this is not needed.
src/test/app/ValidatorList_test.cpp
Outdated
BEAST_EXPECT(trustedKeys->listed(localCfgListed)); | ||
} | ||
|
||
// Manifest published keys with expirations |
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.
Manifest
src/test/app/ValidatorList_test.cpp
Outdated
BEAST_EXPECT( | ||
trustedKeys->load(emptyLocalKey, emptyCfgKeys, cfgKeys)); | ||
|
||
// Initially, no manifest has been published, so never stale |
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.
manifest
--> list
src/test/app/ValidatorList_test.cpp
Outdated
void | ||
testExpires() | ||
{ | ||
testcase("Stale"); |
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.
Consider "Expires"
or "Expiration"
src/test/rpc/ValidatorRPC_test.cpp
Outdated
{ | ||
// The current HTTP/S ServerHandler returns an HTTP 403 | ||
// error code here rather than a noPermission JSON error. | ||
// The JSONRPCClient just eats that error and returns an |
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.
an
--> a
src/test/rpc/ValidatorRPC_test.cpp
Outdated
// Publisher list site unavailable | ||
{ | ||
// Publisher site information | ||
endpoint_type ep{address_type::from_string("127.0.0.1"), 1234}; |
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.
ep
is unused
src/test/rpc/ValidatorRPC_test.cpp
Outdated
BEAST_EXPECT(js[jss::refresh_interval_min].asUInt() == 5); | ||
BEAST_EXPECT(js[jss::uri] == siteURI); | ||
BEAST_EXPECT(js[jss::last_refresh_status] == "accepted"); | ||
// The actual time of the udpate will vary run to run, so |
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.
--> update
else | ||
res[jss::validator_list_expires] = "unknown"; | ||
|
||
// Publisher lists |
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.
Speaking of redundant information, what do you think about including each publisher list's version, which would always be 1
?
curr[jss::pubkey_publisher] = strHex(p.first); | ||
curr[jss::seq] = static_cast<Json::UInt>(p.second.sequence); | ||
curr[jss::available] = p.second.available; | ||
curr[jss::expiration] = to_string(p.second.expiration); |
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.
For the static list in the config, the entry shows up as:
{
"available" : true,
"expiration" : "2136-Feb-07 06:28:15",
"list" : [
"n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7",
"n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj",
"n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C",
"n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS",
"n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA"
],
"pubkey_publisher" : "",
"seq" : 0
}
I'm wondering if these should instead be in a third list (static_validator_keys
?) outside of publisher_lists
, since available
, expiration
, pubkey_publisher
, and seq
are all meaningless.
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.
maybe the three lists returned could be something like
local_static_keys
published_lists
/dynamic_lists
trusted_keys
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.
I like that distinction, but wasn't sure if the preference is to encourage the use of published_lists
over local keys. That being said, its simple to include them.
Maybe the better ordering is:
trusted_keys
local_static_keys
published_lists
?
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.
Since they're keys in a JSON object, I don't think the order is preserved
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.
🤦♂️
@@ -479,14 +479,11 @@ ValidatorList::getJson() const | |||
} | |||
|
|||
// Current validator keys | |||
Json::Value& jValidatorKeys = (res[jss::validator_keys] = Json::arrayValue); | |||
Json::Value& jValidatorKeys = | |||
(res[jss::trusted_validator_keys] = Json::arrayValue); | |||
for (auto const& v : keyListings_) |
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.
keyListings_
--> trustedKeys_
src/ripple/app/misc/NetworkOPs.cpp
Outdated
@@ -2148,6 +2148,21 @@ Json::Value NetworkOPsImp::getServerInfo (bool human, bool admin) | |||
info[jss::validation_quorum] = static_cast<Json::UInt>( | |||
app_.validators ().quorum ()); | |||
|
|||
if (auto when = app_.validators().expires()) |
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.
I'm wondering if this should be admin-only.
However it does seem to be in a similar category as validation_quorum
, which is currently not admin-only.
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.
I could be convinced otherwise, but I like matching validation_quorum
, so that if you ever do get stale and validation_quorum
goes to "infinity", you would know when it happened.
src/ripple/app/misc/NetworkOPs.cpp
Outdated
if (auto when = app_.validators().expires()) | ||
{ | ||
if (human) | ||
info[jss::validator_list_expires] = to_string(*when); |
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.
What do you think about displaying something like "never"
or "no expiration"
if when
equals TimeKeeper::time_point::max()
? Same would apply to the validator_lists
response
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.
I like "never". I'll update it.
src/ripple/rpc/impl/Handler.cpp
Outdated
@@ -151,6 +151,8 @@ Handler handlerArray[] { | |||
{ "unl_list", byRef (&doUnlList), Role::ADMIN, NO_CONDITION }, | |||
{ "validation_create", byRef (&doValidationCreate), Role::ADMIN, NO_CONDITION }, | |||
{ "validation_seed", byRef (&doValidationSeed), Role::ADMIN, NO_CONDITION }, | |||
{ "validator_lists", byRef (&doValidatorLists), Role::ADMIN, NO_CONDITION }, |
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.
What do you think about just calling this validators
?
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.
Makse sense
Do you think validator_sites
should become validator_list_sites
to match https://github.com/ripple/rippled/blob/develop/doc/validators-example.txt#L26?
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.
Yeah, that's clearer
There were some issue with my use of asio in |
src/test/app/ValidatorSite_test.cpp
Outdated
ep2, ioService, pubSigningKeys2, manifest2, sequence, | ||
expiration.time_since_epoch().count(), version, list2); | ||
TrustedPublisherServer server1( | ||
ep1, |
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.
Should we switch to OS port selection for these servers too?
res[jss::validation_quorum] = static_cast<Json::UInt>(quorum()); | ||
|
||
if (auto when = expires()) | ||
res[jss::validator_list_expires] = to_string(*when); |
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.
This should also use "never"
when when
is max()
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.
Uggh, sorry I missed this. Maybe I should just make expires return a string?
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.
Actually, that doesn't work as well with the machine readable response in server_state
. I'll just handle it directly.
src/ripple/rpc/handlers/Handlers.h
Outdated
@@ -85,7 +85,8 @@ Json::Value doWalletPropose (RPC::Context&); | |||
Json::Value doWalletSeed (RPC::Context&); | |||
Json::Value doWalletUnlock (RPC::Context&); | |||
Json::Value doWalletVerify (RPC::Context&); | |||
|
|||
Json::Value doValidatorLists (RPC::Context&); |
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.
--> doValidators
src/ripple/rpc/handlers/Handlers.h
Outdated
@@ -85,7 +85,8 @@ Json::Value doWalletPropose (RPC::Context&); | |||
Json::Value doWalletSeed (RPC::Context&); | |||
Json::Value doWalletUnlock (RPC::Context&); | |||
Json::Value doWalletVerify (RPC::Context&); | |||
|
|||
Json::Value doValidatorLists (RPC::Context&); | |||
Json::Value doValidatorSites (RPC::Context&); |
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.
--> doValidatorListSites
src/test/rpc/ValidatorRPC_test.cpp
Outdated
auto const jrr = env.rpc("validators")[jss::result]; | ||
BEAST_EXPECT( | ||
jrr[jss::validator_list_expires] == | ||
to_string(NetClock::time_point::max())); |
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.
--> "never"
src/test/rpc/ValidatorRPC_test.cpp
Outdated
BEAST_EXPECT( | ||
jp[jss::pubkey_publisher] == strHex(publisherPublic)); | ||
BEAST_EXPECT(jp[jss::expiration] == | ||
to_string(TimeKeeper::time_point{})); |
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.
I'm wondering if seq
and expiration
should either be "unknown"
or excluded in this situation
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.
Is there a way to distinguish a list that was previously loaded and is now unavailable versus one that has not been successfully loaded yet?
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 expiration
would be TimeKeeper::time_point{}
in the latter case. (We would never accept a list with that expiration without a time machine.)
Rebased on 0.80.0 |
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.
Speaking of new ListDisposition
s, this commit adds same_sequence
to distinguish between a fetched list with a previous sequence (and/or expired expiration) from a fetched list with the current sequence, which are both currently treated as stale
.
wilsonianb@cfb2ef6
How do you feel about including the change in this PR since it depends on your to_string
for ListDisposition
?
for (auto const& p : publisherLists_) | ||
{ | ||
if (p.second.available && | ||
TimeKeeper::time_point{} < p.second.expiration) |
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.
I'm wondering if this should return boost::none
if a list has a TimeKeeper::time_point{}
expiration (meaning it hasn't been fetched yet).
As is, we have this subset of possible validator_list_expires
values:
-unfetched list: unknown
-unfetched list & one or more fetched lists: the timestamp of the soonest expiration
-unfetched list & static validator keys: never
I'm leaning toward always making validator_list_expires
to be unknown
if any list has yet to be successfully fetched.
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.
Even though the quorum becomes infinite if a list is unavailable, don't you still process/forward validations for whatever trusted nodes are available? If that is the case, I think providing the expiration of the trusted keys you are using is still useful.
But I don't hold that opinion particularly strongly, so if you prefer the above, I will switch.
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.
We'd still have the expiration
in each publisher_lists
entry for the validators
response to tell us when we might stop trusting and forwarding certain validators.
I've been thinking of validator_list_expires
as indicating the earliest point at which you might have an incomplete trusted validator list and be unable to reach quorum, but we would need to return something like unknown
whenever if we already have an incomplete list.
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.
👍 I'll make the change then.
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.
On a second take, I'm not sure why I was using the available
field in this function. That looks to be used to indicate whether a list has been loaded and is unexpired, but if it expires, we don't want to stop reporting its expiry.
Is the better change to just
- Return
boost::none
if anyexpiration
isTimeKeeper::time_point{}
- Otherwise, return the earliest
expiration
.
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.
Good catch. Changing available
back to false when the list expires was just added in #2240
Your suggested better change looks correct.
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.
It might be worth adding a test to testExpires
and/or testDynamicUNL
to check the when
/validator_list_expires
after a list has expired.
https://github.com/ripple/rippled/blob/cafe18c59279e7de447f25a0e00d0562d6441c7a/src/test/app/ValidatorList_test.cpp#L745-L746
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.
👍 Already working on one in testExpires
.
@@ -267,6 +271,9 @@ ValidatorSite::onSiteFetch( | |||
JLOG (j_.warn()) << | |||
"Unable to parse JSON response from " << | |||
sites_[siteIdx].uri; | |||
|
|||
sites_[siteIdx].lastRefreshStatus.emplace( | |||
Site::Status{clock_type::now(), ListDisposition::invalid}); | |||
} | |||
} | |||
|
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.
We currently don't record a lastRefreshStatus
if there was an error fetching the list.
@mtrippled added an else
for that case here (should this pr be rebased on that branch as well? 😬)
https://github.com/ripple/rippled/pull/2243/files#diff-746977a6800a792fee7608383bca05deR282
I don't know if we should use ListDisposition::invalid
or a new ListDisposition
value?
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.
Yes, will add. I think invalid
works for now. I don't think a new name would any useful actionable information; clients would likely need to querying the publisher site either way to figure out what is going on.
Rebased to include #2243. I went with |
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.
Observation: If a configured trusted publisher key is revoked via its manifest, we simply remove the key and its list.
https://github.com/ripple/rippled/blob/cafe18c59279e7de447f25a0e00d0562d6441c7a/src/ripple/app/misc/impl/ValidatorList.cpp#L279-L283
I don't see a way for us to convey that this happened in the validators
rpc response.
src/test/app/ValidatorList_test.cpp
Outdated
|
||
// Advance past the first list's expiration, but it remains the | ||
// earliest expiration | ||
env.timeKeeper().set(prep1.expiration + 1s); |
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.
I don't think it's necessary, but we could add a call to onConsensusStart
here since that is what updates list information (such as available
) when a list expires.
src/test/rpc/ValidatorRPC_test.cpp
Outdated
BEAST_EXPECT(js[jss::refresh_interval_min].asUInt() == 5); | ||
BEAST_EXPECT(js[jss::uri] == siteURI); | ||
BEAST_EXPECT(!js.isMember(jss::last_refresh_time)); | ||
BEAST_EXPECT(!js.isMember(jss::last_refresh_status)); |
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.
It looks like these last two checks need to be updated
@@ -294,6 +294,9 @@ ValidatorSite::onSiteFetch( | |||
} | |||
else | |||
{ | |||
sites_[siteIdx].lastRefreshStatus.emplace( |
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.
I think we want to get the sites_mutex_
lock here
@@ -294,6 +294,9 @@ ValidatorSite::onSiteFetch( | |||
} | |||
else |
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.
I just realized we probably also want to set lastRefreshStatus
as invalid
in the if
for this else
https://github.com/ripple/rippled/blob/develop/src/ripple/app/misc/impl/ValidatorSite.cpp#L208-L214
I suppose we convey revoking by not having it in the response when the user might expect it. I'm tempted to say that is good enough for now and we can revisit if needed. |
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!
src/ripple/protocol/JsonFields.h
Outdated
JSS ( public_key ); // out: OverlayImpl, PeerImp, WalletPropose | ||
JSS ( public_key_hex ); // out: WalletPropose | ||
JSS ( published_ledger ); // out: NetworkOPs | ||
JSS ( publisher_lists); // out: ValidatorList |
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.
nit: ( publisher_lists)
--> ( publisher_lists )
also for refresh_interval_min
and validator_list_expires
below
#include <BeastConfig.h> | ||
#include <ripple/app/main/Application.h> | ||
#include <ripple/app/misc/ValidatorList.h> | ||
#include <ripple/basics/make_lock.h> |
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.
I think the make_lock.h
include isn't necessary. Ditto for ValidatorListSites.cpp
Thanks for the thorough review and suggestions @wilsonianb! I'll fix the remaining nits and squash it down. |
It looks like this branch has a distinct |
In support of dynamic validator list, this changeset: 1. Adds a new `validator_list_expires` field to `server_info` that indicates when the current validator list will become stale. 2. Adds a new admin only `validator_lists` RPC that returns the current list of known validators and the most recent published validator lists. 3. Adds a new admin only `validator_sites` RPC that returns the list of configured validator publisher sites and when they were most recently queried.
Merged as 044dd53 |
For posterity, the two new methods are documented here: |
In support of dynamic validator list, this changeset
validator_list_expires
field toserver_info
that indicates when the current validator list will become stale.validator_lists
RPC that returns the current list of known validators and the most recent published validator lists.validator_sites
RPC that returns the list of configured validator publisher sites and when they were most recently queried.This builds on PR #2240, which is the first two commits in this changeset.