Disable pathfinding indexing on validator nodes:

The pathfinding engine requires pre-building large tables which is a
resource-intensive operation. Typically, one would not expect that a
server configured as a validator would also support pathfinding APIs
and so, building those tables by default wastes resources.

This commit, if merged, will disable pathfinding on servers that are
configured as validators, unless the server operator opts to support
it explicitly, by configuring the `[path_search_max]` parameter.

Validator operators that wish to support pathfinding on a validator
and want to use the default values can add the following stanza to
their server's configuration file:

    [path_search_max]
    7
This commit is contained in:
Nik Bougalis
2021-11-06 18:25:58 -07:00
parent d36024394d
commit 7edfbbd8bd
3 changed files with 25 additions and 10 deletions

View File

@@ -615,6 +615,11 @@ Config::loadFromString(std::string const& fileContents)
FETCH_DEPTH = 10;
}
// By default, validators don't have pathfinding enabled, unless it is
// explicitly requested by the server's admin.
if (exists(SECTION_VALIDATION_SEED) || exists(SECTION_VALIDATOR_TOKEN))
PATH_SEARCH_MAX = 0;
if (getSingleSection(secConfig, SECTION_PATH_SEARCH_OLD, strTemp, j_))
PATH_SEARCH_OLD = beast::lexicalCastThrow<int>(strTemp);
if (getSingleSection(secConfig, SECTION_PATH_SEARCH, strTemp, j_))