More Validators implementation

This commit is contained in:
Vinnie Falco
2013-09-10 15:53:02 -07:00
parent 43d386fa6e
commit fb804bd1bd
11 changed files with 35 additions and 19 deletions

View File

@@ -3,6 +3,11 @@ RIPPLE TODO
--------------------------------------------------------------------------------
Vinnie's List: Changes day to day, descending priority
- Validators should delay the application of newly downloaded lists from
sources, to mitigate the effects of attacks. Unless there's no validators
in the list.
- Validators RPC options to immediately apply UNL,
manually revisit sources, etc...
- Clean up calculation of COnfig file location.
- Remove TESTNET and all related code and settings.
- Full review of config docs / settings for RPC/WS

View File

@@ -230,17 +230,15 @@ public:
m_validators->addStrings (strings);
}
/*
if (getConfig().getValidatorsFile() != File::nonexistent())
{
m_validators->addFile (getConfig().getValidatorsFile());
}
*/
if (! getConfig().getValidatorsURL().empty())
{
m_validators->addURL (getConfig().getValidatorsURL());
}
if (getConfig().getValidatorsFile() != File::nonexistent ())
{
m_validators->addFile (getConfig().getValidatorsFile());
}
#endif
}

View File

@@ -729,7 +729,8 @@ File Config::getValidatorsFile () const
UniformResourceLocator Config::getValidatorsURL () const
{
String s = "https://" + VALIDATORS_SITE + VALIDATORS_URI;
//String s = "https://" + VALIDATORS_SITE + VALIDATORS_URI;
String s = VALIDATORS_SITE;
return ParsedURL (s).url ();
}

View File

@@ -201,6 +201,7 @@ public:
/** Returns the optional URL to a trusted network source of validators. */
UniformResourceLocator getValidatorsURL () const;
// DEPRECATED
boost::filesystem::path VALIDATORS_FILE; // As specifed in rippled.cfg.
//--------------------------------------------------------------------------

View File

@@ -74,7 +74,6 @@ namespace ripple
#include "validator/ValidatorSourceURL.cpp"
#include "validator/Validators.cpp"
#include "peerfinder/ripple_PeerFinder.h" // private (for now)
#include "peerfinder/ripple_PeerFinder.cpp"
}

View File

@@ -7,9 +7,8 @@
class ValidatorSourceFileImp : public ValidatorSourceFile
{
public:
ValidatorSourceFileImp (String const& path)
: m_path (path)
, m_file (File::getCurrentWorkingDirectory().getChildFile (path))
ValidatorSourceFileImp (File const& file)
: m_file (file)
{
}
@@ -25,16 +24,15 @@ public:
}
private:
String m_path;
File m_file;
};
//------------------------------------------------------------------------------
ValidatorSourceFile* ValidatorSourceFile::New (String const& path)
ValidatorSourceFile* ValidatorSourceFile::New (File const& file)
{
ScopedPointer <ValidatorSourceFile> object (
new ValidatorSourceFileImp (path));
new ValidatorSourceFileImp (file));
return object.release ();
}

View File

@@ -13,7 +13,7 @@
class ValidatorSourceFile : public Validators::Source
{
public:
static ValidatorSourceFile* New (String const& path);
static ValidatorSourceFile* New (File const& path);
};
#endif

View File

@@ -26,6 +26,7 @@ public:
if (httpResult.error == 0)
{
Logger::outputDebugString (httpResult.response->toString ());
}
return result;

View File

@@ -6,6 +6,19 @@
/*
Information to track:
- Percentage of validations that the validator has signed
- Number of validations the validator signed that never got accepted
- Target number for Chosen
- Pseudo-randomly choose a subset from Chosen
Goal:
Provide the listener with a ValidatorList.

View File

@@ -85,7 +85,7 @@ public:
/** @} */
/** Add a static source of validators from a text file. */
virtual void addFile (String const& path) = 0;
virtual void addFile (File const& file) = 0;
/** Add a static source of validators.
The Source is called to fetch once and the results are kept

View File

@@ -401,9 +401,9 @@ public:
ValidatorSourceStrings::New (stringArray));
}
void addFile (String const& path)
void addFile (File const& file)
{
addStaticSource (ValidatorSourceFile::New (path));
addStaticSource (ValidatorSourceFile::New (file));
}
void addURL (UniformResourceLocator const& url)