diff --git a/doc/todo/VFALCO_TODO.txt b/doc/todo/VFALCO_TODO.txt index 6cb5d69a4..14e24ff55 100644 --- a/doc/todo/VFALCO_TODO.txt +++ b/doc/todo/VFALCO_TODO.txt @@ -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 diff --git a/src/ripple_app/main/ripple_Application.cpp b/src/ripple_app/main/ripple_Application.cpp index 5fd2e3c79..c9b12df28 100644 --- a/src/ripple_app/main/ripple_Application.cpp +++ b/src/ripple_app/main/ripple_Application.cpp @@ -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 } diff --git a/src/ripple_core/functional/Config.cpp b/src/ripple_core/functional/Config.cpp index cd3f21b18..75a88acbd 100644 --- a/src/ripple_core/functional/Config.cpp +++ b/src/ripple_core/functional/Config.cpp @@ -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 (); } diff --git a/src/ripple_core/functional/Config.h b/src/ripple_core/functional/Config.h index 39cd91a69..4db627e79 100644 --- a/src/ripple_core/functional/Config.h +++ b/src/ripple_core/functional/Config.h @@ -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. //-------------------------------------------------------------------------- diff --git a/src/ripple_core/ripple_core.cpp b/src/ripple_core/ripple_core.cpp index e45dd7364..b1cfefb1e 100644 --- a/src/ripple_core/ripple_core.cpp +++ b/src/ripple_core/ripple_core.cpp @@ -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" } diff --git a/src/ripple_core/validator/ValidatorSourceFile.cpp b/src/ripple_core/validator/ValidatorSourceFile.cpp index 83c253c09..f937ca887 100644 --- a/src/ripple_core/validator/ValidatorSourceFile.cpp +++ b/src/ripple_core/validator/ValidatorSourceFile.cpp @@ -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 object ( - new ValidatorSourceFileImp (path)); + new ValidatorSourceFileImp (file)); return object.release (); } diff --git a/src/ripple_core/validator/ValidatorSourceFile.h b/src/ripple_core/validator/ValidatorSourceFile.h index 235d046a0..c978b4fe5 100644 --- a/src/ripple_core/validator/ValidatorSourceFile.h +++ b/src/ripple_core/validator/ValidatorSourceFile.h @@ -13,7 +13,7 @@ class ValidatorSourceFile : public Validators::Source { public: - static ValidatorSourceFile* New (String const& path); + static ValidatorSourceFile* New (File const& path); }; #endif diff --git a/src/ripple_core/validator/ValidatorSourceURL.cpp b/src/ripple_core/validator/ValidatorSourceURL.cpp index 039c3ac83..8b18c5d3f 100644 --- a/src/ripple_core/validator/ValidatorSourceURL.cpp +++ b/src/ripple_core/validator/ValidatorSourceURL.cpp @@ -26,6 +26,7 @@ public: if (httpResult.error == 0) { + Logger::outputDebugString (httpResult.response->toString ()); } return result; diff --git a/src/ripple_core/validator/Validators.cpp b/src/ripple_core/validator/Validators.cpp index 10d10eb67..0efa0aeb1 100644 --- a/src/ripple_core/validator/Validators.cpp +++ b/src/ripple_core/validator/Validators.cpp @@ -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. diff --git a/src/ripple_core/validator/Validators.h b/src/ripple_core/validator/Validators.h index 3e29049ee..bb9bcce1c 100644 --- a/src/ripple_core/validator/Validators.h +++ b/src/ripple_core/validator/Validators.h @@ -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 diff --git a/src/ripple_core/validator/ValidatorsImp.h b/src/ripple_core/validator/ValidatorsImp.h index 880897ecb..c1bfb5e5e 100644 --- a/src/ripple_core/validator/ValidatorsImp.h +++ b/src/ripple_core/validator/ValidatorsImp.h @@ -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)