Compare commits

...

175 Commits

Author SHA1 Message Date
Vinnie Falco
a8859b495b Set version to 0.30.0 2015-10-21 18:26:02 -07:00
Miguel Portilla
caccee1d98 Set version to 0.30.0-rc1 2015-10-01 14:18:56 -04:00
seelabs
379110a8a2 Improve treatment of signature components 2015-09-30 21:44:02 -04:00
Miguel Portilla
8d37cd9169 Disable RPC coroutines 2015-09-30 19:05:00 -04:00
Nik Bougalis
b40ade5165 Set version to 0.30.0-b1 2015-09-28 17:30:42 -07:00
wilsonianb
c475b23c7d Fix and update rippled.spec for rpm builds 2015-09-28 17:24:05 -07:00
Miguel Portilla
d6b9cfcc34 Enable websocket coroutines 2015-09-28 17:24:05 -07:00
JoelKatz
0c05bd3def Improve transport security:
* Add fields for local and remote IP addresses in hello.
* Add configuration for known local public IP address
* Set fields appropriately
* Check the fields
* Disallow self connection by key
2015-09-28 17:24:05 -07:00
JoelKatz
8f7ab21423 IPAddressV4 fixes:
* Loopback addresses are not publicly routable
* The Internet is not classful
2015-09-28 17:24:04 -07:00
JoelKatz
07418cfb34 Make transaction ordering much more difficult to predict
Randomize the initial transaction execution order for closed
ledgers based on the hash of the consensus set. Transaction
processing change will take effect October 27, 2015 at
11:00 AM Pacific time.
2015-09-28 17:24:04 -07:00
Vinnie Falco
ac9816c01d Release PeerFinder slot on error 2015-09-28 17:24:04 -07:00
Nik Bougalis
bd3e4ac11c Correctly parse the --rpc_port command line argument 2015-09-28 16:49:46 -07:00
Nik Bougalis
926d08db6f Adjust ledger switch time and disambiguate logging:
- The new activation date for 1e9624270d
  is now October 27, 2015 at 11:00 PDT
2015-09-28 16:49:35 -07:00
Nik Bougalis
a23f6457dc Initialize HTTP client after the config is loaded 2015-09-27 13:17:20 -07:00
Vinnie Falco
4f9dba22c7 Set version to 0.29.1-rc1 2015-09-25 16:21:44 -07:00
Vinnie Falco
97e1a7db25 Merge branch 'release' into develop 2015-09-25 16:21:16 -07:00
JoelKatz
e03effd63b Disable compatible ledger safety if quorum is strict 2015-09-25 14:18:18 -07:00
JoelKatz
f9a65e4966 Add '--valid" command line option to consider starting ledger valid 2015-09-25 14:18:06 -07:00
JoelKatz
3c52fdfabe Allow the "quorum" command line option to lock the quorum 2015-09-25 14:18:03 -07:00
Vinnie Falco
938b2fed7c Set version to 0.29.1-b14 2015-09-25 13:43:32 -07:00
JoelKatz
d6875975ab Fix OpenLedger::empty:
* Fix logic of OpenLedger::empty
* Add regression test
* Remove some dead code
2015-09-25 11:37:54 -07:00
seelabs
92b2ca70b7 Inject journals:
Calls to WriteLog are replaced with injected journals
2015-09-25 06:29:08 -07:00
Vinnie Falco
df6ac8f7f5 Use injected Logs 2015-09-25 06:29:07 -07:00
Nik Bougalis
fa796a2eb5 Inject Config:
* Use dependency injections instead
* Remove deprecated fee interfaces
2015-09-25 06:29:07 -07:00
Miguel Portilla
c7b3153958 Upgrade ripple-lib. Fix OS X warnings 2015-09-24 20:22:07 -04:00
Vinnie Falco
5bbb89753d Set version to 0.29.1-b13 2015-09-22 17:06:23 -07:00
Miguel Portilla
654084d181 Allow partialPayment with path_find 2015-09-22 17:05:51 -07:00
Nik Bougalis
094f08211a Set version to 0.29.1-b12 2015-09-21 10:55:57 -07:00
JoelKatz
74b0a7c633 Improve SHAMap missing node behavior:
* Prevent recursive invocation of missing node handler
* Do not throw from ledger constructor
2015-09-21 10:55:30 -07:00
JoelKatz
8f09d3449d Improve ledger replay logic
Build a replay structure holding the transactions
in execution order along with the close time. Use
this structure when replaying a ledger close.
2015-09-21 10:55:30 -07:00
JoelKatz
0c7a7903b6 Use the new OpenView/OpenLedger classes
The server's open ledger is now an instance of the OpenView
class, managed by an instance of the OpenLedger class. This
should improve the performance of operations on open ledgers
because they are no longer Ledger/SHAMap operation.
2015-09-21 10:55:30 -07:00
seelabs
6a8d24372e Fix Travis compile 2015-09-21 08:59:15 -07:00
Edward Hennis
884dc11365 Set version to 0.29.1-b11 2015-09-18 12:19:32 -04:00
Howard Hinnant
83830ef9c0 Install upper_bound in ReadView:
*  And use it in doLedgerData.
2015-09-18 12:18:41 -04:00
Tom Ritchford
849e1ce5f4 Bring some constants into RPC::Tuning.h. 2015-09-18 12:18:40 -04:00
Nicholas Dudfield
4eb6020813 Add npm test for ledger_data command. 2015-09-18 12:18:39 -04:00
Tom Ritchford
d655fdca56 Honor markers in ledger_data requests (RIPD-1010). 2015-09-18 12:18:39 -04:00
seelabs
b6df6748df Use gcc-5 in travis 2015-09-18 12:18:38 -04:00
seelabs
269809dd1a Transitional support gcc 5.2 2015-09-18 12:18:37 -04:00
Vinnie Falco
65fdf1dc5e Add order book stuffing tests:
* PlumpBook makes sure large order books remain sane
* OversizeMeta checks for tecOVERSIZE handling
* FindOversizeBook probes metadata offer limits
2015-09-18 11:51:49 -04:00
Vinnie Falco
60002bf9bc Improve Env::ter and ter() funclet 2015-09-18 11:51:48 -04:00
Vinnie Falco
dd94de2830 jtx: Allow disabling of sig checks 2015-09-18 11:51:47 -04:00
Howard Hinnant
e1fc81f66f Add override keyword on all derived functions:
This silences warnings on latest clang compiler.
2015-09-18 11:50:33 -04:00
Tom Ritchford
b2cf1e4c65 Extract common function RPC::readLimitField. 2015-09-18 11:18:17 -04:00
Miguel Portilla
a65f692ab7 Disable RPC websocket coroutines 2015-09-18 11:16:12 -04:00
Howard Hinnant
44e4a50050 Fix stack bug in upper_bound 2015-09-18 11:14:34 -04:00
Vinnie Falco
ffbcb96eff Inject Application (cont.) 2015-09-18 11:09:40 -04:00
Scott Schurr
eed1a891a7 Remove TxnSignApiFacade (RIPD-945):
Replace TxnSignApiFacade with separate passed in arguments to
the various sign/submit RPC commands.

Also increase unit test coverage of the submit_multisign RPC
command.
2015-09-18 11:09:37 -04:00
Vinnie Falco
9b787434c9 Inject Application:
Calls to getApp are replaced with dependency injections.
2015-09-18 11:09:22 -04:00
Nicholas Dudfield
f4fe55caff Add coverage tracking via codecov.io
Conflicts:
	.travis.yml
2015-09-17 15:57:56 -04:00
Edward Hennis
8df88238cd Migrate Travis to container-based infrastructure
* http://docs.travis-ci.com/user/migrating-from-legacy/?utm_source=legacy-notice&utm_medium=banner&utm_campaign=legacy-upgrade
2015-09-17 11:46:06 -04:00
Nik Bougalis
ea0bd08660 Set version to 0.29.1-b10 2015-09-13 14:28:46 -07:00
Tom Ritchford
c1f50ca7b3 Use lambdas everywhere in JobQueue.
Conflicts:
	src/ripple/app/ledger/impl/LedgerConsensusImp.cpp
2015-09-13 14:28:38 -07:00
Tom Ritchford
a6f866b4d8 Use std::function in JobQueue. 2015-09-13 14:28:38 -07:00
Tom Ritchford
545b2fd6b1 Better suspend for continuation 2015-09-13 14:28:38 -07:00
JoelKatz
b0a855a10e Upgrade SQLite from 3.8.8.2 to 3.8.11.1 2015-09-13 14:28:37 -07:00
seelabs
b5600e940a Minor VS2015 doc update 2015-09-13 14:28:37 -07:00
seelabs
7f5d273e53 Tidy SetHex* function calls & misc cleanups
* Renamed SetHexExact -> SetHexUnchecked
* Removed calls to SetHexUnchecked with empty strings
* Marked ledger class as final, as it calls virtuals in its ctor
2015-09-13 14:28:37 -07:00
Nik Bougalis
b0e6be93ff Add Rate class to support scaling of IOU and XRP amounts 2015-09-13 14:28:37 -07:00
Nik Bougalis
324c42ae09 Support to_string for IOUAmount and XRPAmount 2015-09-11 14:10:35 -07:00
Nik Bougalis
acd03faee5 Use XRPAmount for fees and ledger headers 2015-09-11 14:10:35 -07:00
Nik Bougalis
94af42da44 Support STAmount conversions to XRPAmount and IOUAmount 2015-09-11 14:10:35 -07:00
Nik Bougalis
1e9624270d Make ledger close times increase strictly monotonically 2015-09-11 12:50:26 -07:00
Nik Bougalis
a50d67257c Limit the total number of offers processed while crossing 2015-09-11 12:46:03 -07:00
JoelKatz
3759c553b0 Remove unfunded offers on tecOVERSIZE 2015-09-11 12:39:08 -07:00
JoelKatz
332114c02a Allow more deliver loops when multiquality 2015-09-11 12:33:19 -07:00
Nik Bougalis
5d841c13b7 Set version to 0.29.0-hf2 2015-09-09 15:19:59 -07:00
Nik Bougalis
caecf78a6d Limit the total number of offers processed while crossing 2015-09-09 15:18:58 -07:00
JoelKatz
408a62f7d0 Remove unfunded offers on tecOVERSIZE 2015-09-09 15:18:58 -07:00
JoelKatz
b822d061ef Allow more deliver loops when multiquality 2015-09-09 09:50:57 -07:00
Vinnie Falco
020a112e77 Set version to 0.29.1-b9 2015-09-08 19:20:54 -07:00
Vinnie Falco
8e33ae78f8 Create zero balance trust lines with auth flag (RIPD-1003):
This allows a TrustSet transaction to create a trust line
if the only thing being changed is setting the tfSetfAuth
flag.
2015-09-08 19:18:08 -07:00
wltsmrz
dbddc6b7f2 Update integration tests 2015-09-08 19:14:42 -07:00
Vinnie Falco
f32be2b28d Fix SusPay condition check in Finish:
On a SusPayFinish, a check is added to make sure that the
presented digest matches the digest in the SusPay ledger
entry. Another check is added to make Finish transactions
containing sfProof fields that are not 32 bytes malformed.

This includes regression unit tests.
2015-09-07 18:12:46 -07:00
Vinnie Falco
0f05ebd834 Set version to 0.29.1-b8 2015-09-07 14:05:27 -07:00
Edward Hennis
14db51e3e4 Visual Studio 2015 support 2015-09-07 14:04:53 -07:00
Edward Hennis
8f3bb286f2 Changes to support VS2015 2015-09-07 14:04:53 -07:00
Nik Bougalis
258c93f8d8 Set version to 0.29.1-b7 2015-09-07 11:28:28 -07:00
JoelKatz
88f885f2e7 Limit changed node count 2015-09-07 11:27:15 -07:00
Nik Bougalis
91eee1a42d Limit the number of offers that can be consumed during crossing 2015-09-07 11:27:09 -07:00
Nik Bougalis
6a55f99ede Set version to 0.29.0-hf1 2015-09-07 09:17:06 -07:00
JoelKatz
0b457497d0 Limit changed node count 2015-09-07 09:16:30 -07:00
Nik Bougalis
b7c9e33343 Limit the number of offers that can be consumed during crossing 2015-09-07 09:00:25 -07:00
Scott Schurr
502d5689bf Set version to 0.29.1-b6 2015-09-03 16:53:12 -07:00
seelabs
d015debe2b Remove unused config param 2015-09-03 15:45:24 -07:00
Howard Hinnant
d8aab5a749 Optimize SHAMapItem construction 2015-09-03 14:18:43 -07:00
Vinnie Falco
7ed2094a6a Fix missing 'age' field from server_info 2015-09-03 14:11:46 -07:00
Miguel Portilla
464410d8be Differentiate path_find response (RIPD-1013) 2015-09-03 14:05:48 -07:00
Vinnie Falco
aa0e17dd93 Add consensus simulations 2015-09-03 13:44:37 -07:00
Vinnie Falco
b2cb4df29a Make suite::log_t public 2015-09-03 13:27:16 -07:00
Miguel Portilla
3d777f3f5d Convert all of an asset (RIPD-655) 2015-09-03 13:10:50 -07:00
Vinnie Falco
1842878c40 Tidy up STPathElement constructor 2015-09-03 12:59:15 -07:00
Vinnie Falco
23f47adb60 Add jtx::path funclet 2015-09-03 12:52:02 -07:00
Nicholas Dudfield
377e3d479c Always show fields that contribute to the hash in ledger header json 2015-09-03 12:30:33 -07:00
Tom Ritchford
d5193a776e Replace calls to new(). (#243)
* Replace all unavoidable uses of `new` with `std::make_unique` or
  `std::make_shared`.

* Fix some 80-column issues.
2015-09-03 12:09:44 -07:00
Scott Schurr
ef51128270 Enable simple multisign with a Feature (RIPD-182):
Eventually multisign will need to be enabled onto the network, at
which point compiling it in or out will no longer be an option.
In preparation, the compile guards are removed and multisign is
being enabled with a Feature.

You can locally enable a Feature using your config file.  To
enable multisign with your config file add a section like this:

[features]
MultiSign

The exact spelling and capitalization of both "features" and
"MultiSign" is important.  If you don't get those right multisign
will not be enabled.

There is a minor issue.  The "sign_for" and "submit_multisigned"
RPC commands are only enabled if multisign is enabled.  However
those commands are still shown in the help message even if
multisign is disabled.  This is because the code that produces
the help message doesn't read the config file (where the Features
are kept).  This problem will become irrelevant once multisign is
enabled onto the network.
2015-09-03 11:43:25 -07:00
Scott Schurr
9b15c88b0e Make Rules available outside of Transactors (RIPD-182):
Allows multisign to be enabled with a Feature.
2015-09-03 11:36:23 -07:00
Scott Schurr
f1c29ae20b Allow an account to be exclusively multisigned (RIPD-182):
An account can be made signable with only its regular key by
disabling the master key.  Now an account can also be made
exclusively multisigned by both disabling the master key and
having no regular key.

In order to prevent an account from becoming unsignable the
network uses these rules:

 o An account can always add or replace a regular key or a
   SignerList as long as the fee and reserve can be met by the
   account.

 o The master key on an account can be disabled if either a
   regular key or a SignerList (or both) is present on the account.
   Either the regular key or the SignerList can be used to
   re-enable the master key later if that is desired.

 o The regular key on an account may only be removed if either the
   master key is enabled or the account has a SignerList (or both).

 o The SignerList on an account may only be removed if either the
   master key is enabled or a regular key is present (or both).

As a consequence of this change, the tecMASTER_DISABLED error
code is renamed to tecNO_ALTERNATIVE_KEY.  The error code number
(130 decimal) is unchanged.
2015-09-03 11:16:36 -07:00
Nik Bougalis
6d2e3da306 Set version to 0.29.1-b5 2015-08-18 11:16:25 -07:00
seelabs
7695ea2822 Remove obsolete test file 2015-08-18 11:16:18 -07:00
seelabs
c729ceab20 Add includes for boost in_place 2015-08-18 11:16:18 -07:00
seelabs
e8643dd8cc Fix calling incorrect require function in tests 2015-08-18 11:16:18 -07:00
Miguel Portilla
7b69592fe1 Pass by reference in succ 2015-08-18 11:16:18 -07:00
Howard Hinnant
12e11721f9 Eliminate redundant traversal logic of SHAMap:
*  Only the const_iterator interface remains.
2015-08-18 11:16:18 -07:00
Tom Ritchford
96c13f0d98 Restrict source files to 80 columns. 2015-08-18 11:16:18 -07:00
Edward Hennis
df728cd2cd Reference fee unit clean up
* Use config object or ledger instead of hard coded value.
* The value is still const, and has no change mechanism.
2015-08-18 11:16:18 -07:00
Edward Hennis
0d7cad8d64 Devirtualize HashRouter
* Include some simple renames
2015-08-18 11:16:17 -07:00
Nicholas Dudfield
d69285f6ad Use unabbreviated "SuspendedPayment" for LedgerEntryType 2015-08-18 11:16:17 -07:00
Scott Schurr
b8e192e058 Increased fees for multisigned transactions (RIPD-182):
Multisigned transactions place a higher load on the network than
non-multisigned transactions, requiring a higher fee.

- A non-multisigned transaction always has a minimum fee - the
  network base fee.

- A multisigned transaction has a minimum fee equal to the number
  of multisigners plus one times the network base fee.
2015-08-18 11:16:17 -07:00
Vinnie Falco
aeebfeab10 Remove unused unl module code 2015-08-18 11:16:17 -07:00
Vinnie Falco
8aafebbb75 Move tests to app/tests 2015-08-18 09:02:25 -07:00
Vinnie Falco
c3da2e1f03 Update to soci 3.2 2015-08-18 08:48:16 -07:00
Nik Bougalis
c8c8003677 Merge commit 'caab155a00ca0158dcb16844bea5326e2a2c2562' into dn 2015-08-18 08:47:41 -07:00
Nik Bougalis
caab155a00 Squashed 'src/soci/' changes from 6e9312c..b2855dc
b2855dc Merge pull request #378 from ravselj/sqlite_memory_leak
bf5dad9 Memory leak fix in sqlite3_session_backend.
165737c Fix incorrect pointer instead pointee comparison.
625db74 Merge pull request #376 from ravselj/cmake_debug_postfix2
f3a1055 Added proper support for SOCI_DEBUG_POSTFIX by changing backend-loader macro. If debug postfix is specified in CMake then it is passed forward to soci-core backend loader which then combines proper name based on build configuration.
3459d7d Minor CMake fix that checks if shared mode is set before adding shared test(s).
66d407a Merge pull request #373 from musopr/ambiguous_session
9070742 Merge pull request #372 from musopr/clang_cxx_c11
7b08ec7 Fixed ambiguous 'session' reference
e9748de Include SOCI_CXX_VERSION_FLAGS when compiling Clang
abd6775 Merge pull request #368 from ravselj/cmake_debug_postfix
cae0086 Added CMAKE_DEBUG_POSTFIX to SOCI_LIB_SUFFIX. This fixes backend loading when CMAKE_DEBUG_POSTFIX is used.
3dd4726 Enable MSVC multi process compiling by setting /MP flag.( VS2005+ )
e5f577f Merge pull request #365 from ravselj/sqlite_msvc_fixes
c4dde08 Some trivial fixes in code to resolve MSVC warnings in SQLite back-end
330f0e0 Merge pull request #364 from ravselj/connection_pars
b78c8ef Merge pull request #358 from ArnaudD-FR/bind_clean_up
9f415ee Merge pull request #362 from ArnaudD-FR/sqlite3_optim_split
f1f0162 sqlite3 backend optimizations
0b1a835 Include soci-platform.h because of snprintf
ac65d58 Merge pull request #361 from ArnaudD-FR/blob
24c8383 Bug fix - std::map with key type of const char* is replaced with std::string
3e02a54 Changes due to compiler warnings.
0c88f8c New data_type dt_blob and simple-interface support
403b8de Fix bind_clean_up when using 'row'
92ada95 Merge pull request #363 from ravselj/oracle_win_fix
d1ad52f Add a unit test for CHAR(N) fields padding behaviour.
274d08a Explicitly set character set in Firebird unit tests for CHAR(N).
7623f76 More and better MSVC warnings fixes.
caa2370 Removed dummy and not compilable operator<<(boost::optional).
c025cc8 Fix inserting strings longer than 8000 bytes with ODBC/MS SQL.
d8d765f Update documentations
b5d6507 - oracle cmake Windows fix - test oracle compilation error fix
a6b3514 Split Statement::clean_up into bind_clean_up and clean_up
ba453c7 Make SQL state in ODBC backend error messages more clear.
a374e54 Make ODBC backend error messages more homogeneous.
c4255c9 Delete old /docs folder.
0d3b6b9 Merge pull request #344 from OniDaito/markdown_doc
04f9461 Merge pull request #352 from ravselj/cmake_bug_shared
955a915 - CMake bug fix when building MSVC with SHARED option enabled
f7be373 Merge pull request #348 from msobczak/classic-makefiles
36f373f Added classic Makefile for PostgreSQL test.
615cb94 Updated classic Makefile for PostgreSQL backend.
821092c Don't use both -ansi and -std=gnu++98 flags with g++.
07543f5 Merge pull request #346 from msobczak/classic-makefiles
291fbe7 Merge pull request #347 from jsonn/master
a87776e Make it easier to override SOCI_LIBDIR.
96e66f5 Corrected handling of generated file with backend search path.
0b26c32 Updated classic Makefiles for Oracle Express 11.2.
15a3705 Removed all the crap debian packaging threw in
6db2a65 Merge pull request #343 from OniDaito/master
cf11404 Added Markdown docs
ffbfdc0 Inlined the pragmas for the C++11 tests
ae3ac9d Mistake with CXX11 pragma fixed in session.h
303a966 Merge pull request #341 from mloskot/issues/340
7d7516d Add more qualifications uses of session class with namespace soci::session.
caa3e2b Merge pull request #335 from mloskot/issues/258
1e89d43 Fully qualify uses of session class with namespace soci::session.
1ed81ca Restore setting session with query transformation
84d29e2 Merge branch 'pull/336'
949924a Cope with GNU <=4.6 warning about the #pragma
3494b2b Wrap stream operator for boost::optional<int> with HAVE_BOOST
af4b1a3 Report SOCI_CXX_C11 in CMake output
5744a16 Merge branch 'master' of https://github.com/OniDaito/soci into pull/336
0ab7b37 Remove old build .tcl scripts.
8f2195a Check Postgression availability before proceeding with build.
cd3af53 Remove #include "error.h" of non-existent header
48a8bfa Added the C++11 changes back in
1aee2d1 Add -Wl,-flat_namespace -Wl,-undefined -Wl,suppress to LINK_FLAGS on Apple/OSX
2bf3aa7 Disable test of set_query_transformation with C++ lambda
1d26033 CMake should not terminate on unknown toolset
d8b64cb Remove SociSystemInfo.cmake modul as redundant.
fc3391f List Boost.DateTime in core dependencies
f4ff281 Indicate Travis CI builds Oracle WITH_BOOST=OFF
4863376 Merge pull request #326 from mloskot/issues/224
0c18240 Restore Oracle build with tests on Travis CI.
bc4abd7 Throw instead of truncating VARCHAR columns in Firebird backend.
4c612af No changes, just small code simplification in Firebird backend.
ba206ed Extract common part of MySQL and ODBC MySQL tests in a header.
a0fd859 Remove asserts from the SOCI headers and code.
b36944c Check vector indices instead of asserting that they are valid.
75ef8d8 Handle dt_unsigned_long_long in the "simple" SOCI layer.
2e2f60b Remove asserts on unknown type from the "simple" SOCI layer.
e21aef7 Throw instead of asserting if connection_pool::lease() fails.
4b4cecb Replace left over asserts with CATCH CHECK in the tests code.
388a8d3 Use compile-time asserts to check SQLINTEGER size.
af80fd8 Use SQLT_BDOUBLE instead of SQLT_FLT in Oracle backend.
c74132b Fix warning about pointer-to-int conversion in Firebird backend.
4916551 Reorganize more unit tests to use CATCH sections.
787b428 Fix duplicate test name in Oracle unit tests.
7f65799 Avoid warnings about int-to-pointer conversions in DB2 backend.
7e80c68 Use parameter names from the query, if given, in error messages.
8b0c372 Don't clean up SQLite3 statement prematurely.
9119ed8 Rename db2_statement_backend::names field to names_.
f5c86b7 Make SOCI_NORETURN public and use it in declaration.
62c17b2 Add mktime_from_ymdhms() helper.
ee0b9e4 Fix a clash between CATCH test cases defined in different files.
60a33f4 Reorganize "Use and into" unit test to use CATCH sections.
db59a48 Merge pull request #314 from rpiotaix/release/3.2
82ea95f Don't add DB2_INCLUDE_DIR to global include directories.
4f570d7 Restore Travis CI builds for other databases
71edca9 Merge pull request #306 from mloskot/postgression
1e4b365 Add a Travis build using PostgreSQL server at Postgression.
6abb7e1 Typo
1ccff47 Replace raw & with &amp; entity.
56d3aa6  No real changes, just remove trailing whitespace.
ef6d90d Fix previous attempt to correct include of SQLite3 backend header
31a22a1 Include SQLite3 backend public headers using soci/ prefix.
e4376ed Merge branch 'master' into develop-3.2.3
111b50a Merge branch 'hotfix/3.2.3'
0ef4912 Add 3.2.3 release notes
8da98b2 Add new contributors
ee7e155 Bump version number in docs
30c02f3 Merge branch 'master' of git://github.com/Alex-Vol/soci into hotfix/3.2.3-PR263
5577606 Improve readability of ODBC error message Closes #229
8e14c5b Improve error message when an odbc error occurs
8a50af6 Merge branch 'hotfix/3.2.3' of https://github.com/SOCI/soci into hotfix/3.2.3
a948ab3 Remove unused HAVE_XXX defines
2c85be1 Fix missing strtoll on Cygwin and MinGW
d9c059e Clarify documenation and examples on bulk operations.
a08d750 [travis] Disable Oracle build
70e67aa Replace prefix underscore with suffix in private member names
c799e4f Append each member of tuple/fusion instead of adding tuple/fusion
645e7a2 Merge github.com:pacocamberos/soci into pacocamberos-branch-mysql-blob
e96bc2b Ignore CMakeLists.txt.user created by Qt Creator IDE
f694e30 Bump library version number to 3.2.3
5ecebe9 fixed link error for msvc 64 bit
3278579 Fix email notifications for Travis CI builds.
ad9075c Configure Travis CI to fail the build a.s.a.p.
7481868 Explicitly set extra_float_digits when using PostgreSQL in ODBC.
83bbbd4 update sqlite3 backend documentation
57530a1 Merge pull request #302 from vadz/rich-exceptions
5cda82a Avoid throwing from soci_error copy ctor and assignment operator.
8bb6610 Provide context of the error in soci_error when possible.
a8ba1cb Add use_type_base::dump_value() for richer diagnostics.
76b3089 Add soci_error::get_error_message() method.
e8e5978 No real changes, just remove trailing whitespace.
a90018b Merge catch-tests branch.
7b8b37b Use REQUIRE() and not CHECK() for a test that can't be allowed to fail.
c9dbe19 Move all tests from tests/assert to tests directory itself.
246f657 Convert the tests to use CATCH testing framework.
b2060fb Add single header version of CATCH testing framework.
b87407e Add values::get_number_of_columns() accessor.
9628081 Define SOCI_NORETURN: a portable __attribute__((noreturn)) equivalent.
6ebcbcd Remove the never used details::statement_impl::namedUses_.
0f1f295 Add helper exchange_type_cast<>() template function.
02207fc Rename "version" class in the ODBC test to "odbc_version".
42549d0 Merge pull request #297 from nbougalis/unshadow
7d5eb2d Use a base-class member instead of shadowing it.
37fbe8f Don't always disable ODBC MS SQL test under Unix, just when using Travis.
ed37399 Fix ODBC backend get_affected_rows() when using FreeTDS driver.
f212ca9 Skip test which fails when using ODBC with MS SQL Server.
629386f Merge pull request #294 from denisarnaud/develop
294becb Fix for the issue #169: cleaner way to include headers.
120b88c Accept oraocci12 as a possible Oracle library name too.
8e1ddcd Merge pull request #213 from ayllon/develop
6552eb1 No real changes, just simplify Firebird backend code a little.
34be702 Test exact round trip for NUMERIC values for all backends.
24c0539 Fix rounding error in Firebird NUMERIC/DECIMAL conversions.
69352bc Speculatively enable exact floating point comparisons for all backends.
f497fb8 Disable exact floating point when using PostgreSQL ODBC driver.
6f9dd54 No changes, just fix a repetitive typo in "assert" in comments.
02f0a69 No changes, just remove annoying "EXECEPTION" typo.
4bf2d3c Explicitly disable exact floating point comparison in MySQL test.
1f3dd92 Replace accidental assignment with a comparison in Firebird unit test.
c3cd309 Make text-to-double conversion exact in PostgreSQL backend.
ff9146a Explicitly disable exact floating point comparison in SQLite test.
7039d00 Compare floating point values exactly in tests whenever possible.
53cd24e Don't start implicit transaction too eagerly in Firebird backend.
66f0d82 Add possibility to build Firebird using embedded library.
1489811 Update version to 4.0.0 in cmake too.
5838cc6 Reenable building, if not testing, Oracle backend.
dc4fb73 Move ORACLE_HOME to Oracle-specific script.
f9167a1 Avoid many warnings about floating point values comparison.
c85744b Define GCC_WARNING_SUPPRESS and GCC_WARNING_RESTORE macros.
ef7e9a9 Avoid warning about set but unused variable in Oracle backend.
86a4598 Avoid g++ warnings about casting away const with C-style casts.
2c887b3 Ignore CMake-generated files.
f61d7f5 Add missing include for std::max
21824a1 fixed deadlock in soci::connection_pool::try_lease
6e6bd46 Documentation for SQLite3 result code support.
97cbb0a Update PostgreSQL backend documentation for UUID type support.
5448cf1 Spelling fix in an error message: s/Commiting/Committing/.
5b073e3 Remove the unnecessary "error.h" inclusion from PostgreSQL code.
5776dd4 Introduced sqlite3_soci_error exception as subclass of soci_error. This new exception exposes the SQLite3 result code returned when any failure happens. Using this method is preferable to scrubbing string error messages in soci_error exceptions. Useful when there needs to be a distinction between general errors and database constraint errors. Unit test added to prove the funtionality does what is expected.
6d766e7 Introduced support for UUID column type in PostgreSQL statement.cpp. Unit test added for UUID column support testing all supported kinds of UUID formatted strings on input and standardized UUID formatted strings on output.
e106dc0 Optionally use the environment locale in the tests.
1b65061 Make sqlite3 and mysql backends work with any locale too.
8548642 Use locale-independent function for converting doubles to strings.
1260d4f Reimplement cstring_to_double() without using C++ standard library.
bc884fe Remove unused HAVE_XXX defines
4ffb21b Fix missing strtoll on Cygwin and MinGW
7bd4991 Clarify documenation and examples on bulk operations.
4d0785e Temporarily disable using Oracle backend on Travis.
da7e42c Merge pull request #242 from vadz/pgsql8-bytea
070b278 Merge branch 'fix_odbc_msvc_x86_64' of github.com:snikulov/soci into snikulov-fix_odbc_msvc_x86_64
fce8560 [travis] Disable Oracle build
0ff0e01 Replace prefix underscore with suffix in private member names
65a5ee3 Append each member of tuple/fusion instead of adding tuple/fusion
8e9fb42 Merge github.com:pacocamberos/soci into pacocamberos-branch-mysql-blob
3dca4e3 Ignore CMakeLists.txt.user created by Qt Creator IDE
de7e6f0 Bump library version number to 3.2.3
946dd5a Fix PostgreSQL unit test to pass with PostgreSQL < 9.0.
0a47eaf vs2013 got strtoll/strtoull
58d31f9 Update version to 4.0.0.
89df841 Merge pull request #239 from vadz/soci-headers-prefix
417ef5c Include all public headers using "soci/" prefix inside SOCI itself.
5a99a15 Merge pull request #238 from vadz/cstrtod
0585bb1 Merge pull request #237 from vadz/odbc-header-fix
6f4162c Add helper cstring_to_double() and use it in PostgreSQL backend.
73119cb Fix compilation of ODBC-specific SOCI header with new include paths.
d877390 Delete obsolete src/<backend>/test directories
06a970f Revert CMake setup for ODBC DB2 test
f04147a Move ODBC test DSN files to new tests location
0219c43 Fix paths to ODBC test DSN files
928174c Fix Firebird includes of private headers
bc171b6 Fix copy-n-paste error in CMake macro parameter name
1f4d6ef Fix includes to point to backend headers in subdirectories
552e81c Enable other tests in tests/assert
7a018a3 Move tests/assert into separate subdirectories
e2ec7ff Ignore Qt Creator and Eclipse files
5d527ec Fix windows.h case for cross-compilation
024ccc8 Firebird: fix harmless warning in 64 bit builds.
802f78e Merge pull request #216 from dgrambow/develop
32c5f88 Add get_last_insert_id tests for sqlite3 and mysql backends
ccd4c0d Add get_last_insert_id for sqlite3 and mysql backends Update docs/beyond.html accordingly
42aec23 Fix in soci::oracle to allow spaces in the params
b2ea9f7 fixed link error for msvc 64 bit
ef69fa9 [travis] Disable building tests due to #199
09acb8c [travis] Fix bash script syntax error
cba671f [travis] Disable ctest run due to #199
d8f7d9d [travis] Restore soci-devel notifications
22257b3 [cmake] Remove unused log message
0cffb8a CMake 2.8.7 have problems with per target includes
b430cb0 Attempt to correct -I paths for backend test
6c0721d Attempt to correct -I paths for backend folders
69d70c5 [travis] Disable tempoarily soci-devel notifications
f4802f1 [travis] Log build script name
8890aea [travis] Set CMAKE_VERBOSE_MAKEFILE=ON
717c38a [travis] Remove superfluos ] from make invocation
843a43c Fix travis-ci to run CMake from root directory
9e43795 Update copyright year
da025df Merge branch 'feature/125-new-layout' into develop
04a34f2 Link presentation from London C++ Meeting
11ef1fa Fix doc/index.html menu links
5393ee5 Merge branch 'hotfix/3.2.2' into develop
b6d97ff Implement new source tree layout #125

git-subtree-dir: src/soci
git-subtree-split: b2855dce54340522f149221c6ebe2d14fd1129ba
2015-08-18 08:43:51 -07:00
Nik Bougalis
1b85b6eaba Set version to 0.29.1-b4 2015-08-04 14:55:43 -07:00
JoelKatz
863add6a19 Remove spurious format string from log 2015-08-04 14:55:30 -07:00
JoelKatz
64b80e0573 Fix ledger loading on startup 2015-08-04 14:55:30 -07:00
Nik Bougalis
ed902d9dea Set feature activation date to Aug 17 2015-08-04 14:55:30 -07:00
Nik Bougalis
f38b373cb6 Exit if OpenSSL doesn't have secp256k1 support (RIPD-900) 2015-08-04 14:40:16 -07:00
Nik Bougalis
b8f2fdb6ac Remove obsolete DHUtil 2015-08-04 14:40:16 -07:00
Nik Bougalis
182f570f24 Reduce Transactor virtual interface 2015-08-04 14:40:16 -07:00
Nik Bougalis
5b90ccf65d Validate fee during preflight 2015-08-04 14:40:16 -07:00
Edward Hennis
22a8e25538 Fix display discrepancy in fee. 2015-08-04 14:40:16 -07:00
Edward Hennis
d63aab6312 Test display discrepancy in fee. 2015-08-04 14:40:16 -07:00
seelabs
774dcad392 Remove common_ledger 2015-08-04 13:51:02 -07:00
Tom Ritchford
7b7b27ee9e Replace tabs with spaces. 2015-08-04 13:51:02 -07:00
Vinnie Falco
c5adbc859a Fix OpenView::sles 2015-08-04 13:51:02 -07:00
Vinnie Falco
2cc12b2f2f Add Env::meta() 2015-08-04 13:51:02 -07:00
Vinnie Falco
13b33b5d4d Store STTx in JTx
Conflicts:
	src/ripple/test/jtx/impl/Env.cpp
2015-08-04 13:51:02 -07:00
Howard Hinnant
c7dea3ed17 Improve LoadFeeTrack::scaleFeeLoad:
* Move lock protection to where it is needed.
* Use gcd to reduce problem to lowest terms.
* Use improved overflow avoidance to retain
  as much precision as possible.
* Detect overflow if it can be shown that the
  final result will not fit in a uint64_t.
2015-08-04 13:51:01 -07:00
Edward Hennis
a7e6ecb5b3 Devirtualize LoadFeeTrack 2015-08-04 13:51:01 -07:00
Nik Bougalis
e45c1b238f Set version to 0.29.1-b3 2015-07-31 17:42:16 -07:00
Tom Ritchford
d166e6a45e Add more documentation to Builds/Test.py. 2015-07-31 17:41:27 -07:00
Vinnie Falco
e759137f15 Thread SusPay to all affected accounts 2015-07-31 17:41:05 -07:00
JoelKatz
0bb570a36d Be paranoid about ledger compatibility:
* Consider ledgers incompatible based on last valid ledger
* Test against even ledgers not acquired yet
* Don't validate an incompatible ledger
* Don't switch to an incompatible ledger
* Protect against an unreasonably small quorum
2015-07-31 17:40:39 -07:00
JoelKatz
38c6083a2f Reduce some logging severity 2015-07-31 17:39:39 -07:00
JoelKatz
cfdf0d2f0a Remove a ledger from the set of present ledgers where needed
* If we encounter it in RPC
* If we fully-validate a ledger that doesn't have it in its history
2015-07-31 17:39:35 -07:00
JoelKatz
f0dc2bc425 Confirm valid suspend before relying on suspension 2015-07-31 17:39:14 -07:00
Tom Ritchford
32ec3fe089 Remove trailing spaces. 2015-07-31 17:39:03 -07:00
Scott Schurr
9e69bd5c56 Simple multisigning (RIPD-182):
With this changeset two-level multisigning is removed from the
codebase and replaced with single-level multisigning.

Additionally, SignerLists in the ledger are prepared for the
possibility of multiple SignerLists per account.  This was done
by adding a defaulted 32-bit SignerListID to each SignerList.
The SignerListIndex calculation incorporates the SignerListID.

There are three known missing elements:

 1. Multisigned transactions should require higher fees than
    regular (single-signed) transaction.  That's not yet
    implemented.

 2. It should be possible to disable the master key on an account
    if that account is multisign enabled (has a signer list).
    That's not yet implemented.

 3. Documentation about multisigning needs to be improved.

Multisigning is still compiled out of the code base.  To enable
multisigning for a stand-alone rippled, change the
RIPPLE_ENABLE_MULTI_SIGN macro (in BeastConfig.h) to "1" and
rebuild.

This commit also addresses:
 o RIPD-912: Remove multisign APIs from STObject, and
 o RIPD-944: Replace common_transactor with jtx at call sites.
2015-07-31 17:31:18 -07:00
Vinnie Falco
ceeb36039e New peer to peer network simulators 2015-07-31 17:31:01 -07:00
Vinnie Falco
2bfae2f0ac Tidy up UNL module:
* Renamed module to unl
* Renamed classes and members
* Removed cyclic dependency in Horizon
2015-07-31 17:30:56 -07:00
Nik Bougalis
5d2d88209f Set version to 0.29.1-b2 2015-07-29 12:50:58 -04:00
Nik Bougalis
ecf1a3c69c Initialize close offset 2015-07-29 12:50:41 -04:00
Vinnie Falco
3f0eacf5e7 Add SuspendedPayment feature (RIPD-992):
The code is enabled in jtx::Env, and enabled in production
ledgers only if the SuspendedPayment amendment is voted
into a ledger.
2015-07-29 11:56:10 -04:00
Vinnie Falco
d49f9ea109 Add [features] section to .cfg:
This non-production config section allows features to be enabled
by listing their text descriptions, one line each, in the config
section titled "features".

NOTE: Feature names with leading or trailing whitespace, or
      containing an equals sign ('=') are not supported.
2015-07-29 11:56:08 -04:00
Vinnie Falco
2ec40cb6f1 Add operator[] field accessors to STObject:
New array index operators allow for concise reading and
writing of fields in the STObject, with associated unit test.
2015-07-29 11:56:07 -04:00
Vinnie Falco
3e342e4b71 Add st.h module header 2015-07-29 11:56:05 -04:00
Vinnie Falco
147fee0272 Add describeOwnerDir 2015-07-29 11:56:04 -04:00
Vinnie Falco
fa900de548 Fix applyFlags when testing is disabled 2015-07-29 11:56:02 -04:00
Vinnie Falco
8cd44c637d Add except, unexcept in suite 2015-07-29 11:56:01 -04:00
Vinnie Falco
729caaacff Add THROW contract call 2015-07-29 11:56:00 -04:00
Edward Hennis
2f5d721ec1 Track STTx validity with HashRouter. (RIPD-977) 2015-07-29 11:55:58 -04:00
Edward Hennis
c15394c42a Add preflight functionality to transactors:
The preflight() function performs static validity
analysis of transactions without requiring a ledger.

* Use tx in ApplyContext
* Remove unused journal
* Document apply()
* Add preflight(), which takes an OpenView, uses its rules.
* Change `TER preCheck` to `void preCompute` since it can no longer fail.
2015-07-29 11:55:57 -04:00
JoelKatz
36a62f110c Switch some Ledger instances to ReadView instances
* Remove ltCURRENT
* Change getOwnerInfo
* Use ReadView in TransactionSign
* Change AcceptedLedger and ProposedTransaction to use ReadView
* Change RPC::accounts
2015-07-29 11:46:01 -04:00
Nik Bougalis
2d02b46253 Fix parsing in ledger_request 2015-07-28 20:27:00 -07:00
Miguel Portilla
6cf75f0fc2 Add uptime to crawl data (RIPD-997) 2015-07-28 20:26:51 -07:00
Nik Bougalis
1a3e2e3f36 Set features activation to Aug 10 2015-07-28 20:26:41 -07:00
Tom Ritchford
645e32b19e Fix coroutine suspend 2015-07-28 20:26:30 -07:00
Tom Ritchford
fa0a61b5d7 Revert "Always use co-routines:"
This reverts commit 3d6e76046c.
2015-07-28 20:26:19 -07:00
Vinnie Falco
1dc3acb071 Set version to 0.29.1-b1 2015-07-23 14:23:23 -07:00
Vinnie Falco
0cf58cc505 Add Rules to ReadView:
An instance of Rules provides information on the tx
processing rules in a particular ledger.

* OpenView allows rules to be set on construction.

Conflicts:
	src/ripple/unity/ledger.cpp
2015-07-23 14:23:13 -07:00
Vinnie Falco
eb49e1bf47 Convert OrderBookDB to ReadView 2015-07-23 14:23:13 -07:00
Vinnie Falco
0627d3487b Add OpenLedger::empty 2015-07-23 14:23:13 -07:00
Vinnie Falco
84161b86c7 Add ReadView::sles 2015-07-23 14:23:12 -07:00
Vinnie Falco
110bbf3956 Add CachedLedger:
This type alias provide cache-wrapping for Ledger objects.
Through the CachedLedger interface, access to the underlying
Ledger is permitted to allow for cases where the implementation
must perform Ledger specific activities. For example, building
a fetch pack from the contained SHAMap objects.

The CachingReadView is refactored:

* Renamed to CachedView
* Templated on Base, the base type
* base() returns a shared_ptr to the wrapped object
* Constructor requires a shared_ptr<Base>
2015-07-23 14:23:12 -07:00
Vinnie Falco
fad9998f9d Remove deprecated abstract_clock::elapsed 2015-07-23 14:23:12 -07:00
Vinnie Falco
b38a96ae82 Add TimeKeeper:
This class tracks Ripple network time and closing time.

Conflicts:
	src/ripple/ledger/ReadView.h
2015-07-23 14:23:11 -07:00
Vinnie Falco
e82d774d32 Move SNTPClient to core:
* Refactor SNTPClient
* asio best practices
* Not derived from Stoppable
2015-07-23 14:23:11 -07:00
Miguel Portilla
8d1b169f5a Skip List unit test (RIPD-926) 2015-07-23 14:23:11 -07:00
Miguel Portilla
70ccdabf7c Squelch logs in Env (RIPD-982) 2015-07-23 14:23:10 -07:00
Nik Bougalis
af36942e1f Tidy up offer crossing:
* Clarify use of cancel view in OfferCreate transactor
* Reduce OfferStream public interface
* Reduce severity of some developer-only logging from ERROR to DEBUG
2015-07-23 14:23:10 -07:00
Nik Bougalis
b1b98fa3b0 Tidy up JLOG 2015-07-23 14:23:08 -07:00
Tom Ritchford
bb251063fc Remove deprecated 'accepted' parameter. 2015-07-23 12:34:08 -07:00
Tom Ritchford
663742e0d1 Fix compilation warnings in secp256k1. 2015-07-23 12:34:07 -07:00
1028 changed files with 64108 additions and 42567 deletions

5
.gitignore vendored
View File

@@ -24,6 +24,11 @@ bin/rippled
Debug/*.* Debug/*.*
Release/*.* Release/*.*
# Ignore coverage files.
*.gcno
*.gcda
*.gcov
# Ignore locally installed node_modules # Ignore locally installed node_modules
/node_modules /node_modules

View File

@@ -1,70 +1,84 @@
sudo: false
language: cpp language: cpp
compiler:
- clang
- gcc
env: env:
- TARGET=debug global:
- TARGET=debug.nounity # Maintenance note: to move to a new version
# We can specify any combination of builds here, for example, to # of boost, update both BOOST_ROOT and BOOST_URL.
# include release builds, too, uncomment the following lines. # Note that for simplicity, BOOST_ROOT's final
#- TARGET=release # namepart must match the folder name internal
#- TARGET=release.nounity # to boost's .tar.gz.
- BOOST_ROOT=$HOME/boost_1_59_0
- BOOST_URL='http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.59.0%2Fboost_1_59_0.tar.gz%2Fdownload&ts=1441761349&use_mirror=skylineservers'
- RIPPLED_OLD_GCC_ABI=1
packages: &gcc5_pkgs
- gcc-5
- g++-5
- python-software-properties
- protobuf-compiler
- libprotobuf-dev
- libssl-dev
- libstdc++6
- binutils-gold
# Provides a backtrace if the unittests crash
- gdb
packages: &gcc48_pkgs
- gcc-4.8
- g++-4.8
- python-software-properties
- protobuf-compiler
- libprotobuf-dev
- libssl-dev
- libstdc++6
- binutils-gold
# Provides a backtrace if the unittests crash
- gdb
matrix:
include:
- compiler: gcc
env: GCC_VER=5 TARGET=debug.nounity
addons: &ao_gcc5
apt:
sources: ['ubuntu-toolchain-r-test']
packages: *gcc5_pkgs
- compiler: gcc
env: GCC_VER=5 TARGET=coverage
addons: *ao_gcc5
- compiler: clang
env: GCC_VER=4.8 TARGET=debug
addons: &ao_gcc48
apt:
sources: ['ubuntu-toolchain-r-test']
packages: *gcc48_pkgs
- compiler: clang
env: GCC_VER=4.8 TARGET=debug.nounity
addons: *ao_gcc48
- compiler: gcc
env: GCC_VER=4.8 TARGET=debug
addons: *ao_gcc48
- compiler: gcc
env: GCC_VER=4.8 TARGET=debug.nounity
addons: *ao_gcc48
cache:
directories:
- $BOOST_ROOT
before_install: before_install:
- sudo apt-get update -qq - bin/ci/ubuntu/install-dependencies.sh
- sudo apt-get install -qq python-software-properties
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo add-apt-repository -y ppa:afrank/boost
- sudo apt-get update -qq
- sudo apt-get install -qq g++-4.8
- sudo apt-get install -qq libboost1.57-all-dev
- sudo apt-get install -qq mlocate
- sudo updatedb
- sudo locate libboost | grep /lib | grep -e ".a$"
- sudo apt-get install -qq protobuf-compiler libprotobuf-dev libssl-dev exuberant-ctags
# We need gcc >= 4.8 for some c++11 features
- sudo apt-get install -qq gcc-4.8
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
- sudo update-alternatives --set gcc /usr/bin/gcc-4.8
# Stuff is gold. Nuff said ;)
- sudo apt-get -y install binutils-gold
# We can get a backtrace if the guy crashes
- sudo apt-get -y install gdb
# What versions are we ACTUALLY running?
- g++ -v
- clang -v
# Avoid `spurious errors` caused by ~/.npm permission issues
# Does it already exist? Who owns? What permissions?
- ls -lah ~/.npm || mkdir ~/.npm
# Make sure we own it
- sudo chown -R $USER ~/.npm
script: script:
# Set so any failing command will abort the build - bin/ci/ubuntu/build-and-test.sh
- set -e
# Make sure vcxproj is up to date
- scons vcxproj
- git diff --exit-code
# $CC will be either `clang` or `gcc` (If only we could do -j12 ;)
- scons $CC.$TARGET
# We can be sure we're using the build/$CC.$TARGET variant (-f so never err)
- rm -f build/rippled
- export RIPPLED_PATH="$PWD/build/$CC.$TARGET/rippled"
# See what we've actually built
- ldd $RIPPLED_PATH
# Run unittests (under gdb)
- | # create gdb script
echo "set env MALLOC_CHECK_=3" > script.gdb
echo "run" >> script.gdb
echo "backtrace full" >> script.gdb
# gdb --help
- cat script.gdb | gdb --ex 'set print thread-events off' --return-child-result --args $RIPPLED_PATH --unittest
- npm install
# Use build/(gcc|clang).$TARGET/rippled
- |
echo "exports.default_server_config = {\"rippled_path\" : \"$RIPPLED_PATH\"};" > test/config.js
# Run integration tests
- npm test
notifications: notifications:
email: email:
false false

View File

@@ -17,18 +17,29 @@
""" """
Invocation: Invocation:
./Builds/Test.py - builds and tests all configurations ./Builds/Test.py - builds and tests all configurations
# The build must succeed without shell aliases for this to work.
# The build must succeed without shell aliases for this to work.
# To pass flags to scons, put them at the very end of the command line, after
# Common problems: the -- flag - like this:
# 1) Boost not found. Solution: export BOOST_ROOT=[path to boost folder]
# 2) OpenSSL not found. Solution: export OPENSSL_ROOT=[path to OpenSSL folder] ./Builds/Test.py -- -j4 # Pass -j4 to scons.
# 3) scons is an alias. Solution: Create a script named "scons" somewhere in
# your $PATH (eg. ~/bin/scons will often work).
# #!/bin/sh Common problems:
# python /C/Python27/Scripts/scons.py "${@}"
1) Boost not found. Solution: export BOOST_ROOT=[path to boost folder]
2) OpenSSL not found. Solution: export OPENSSL_ROOT=[path to OpenSSL folder]
3) scons is an alias. Solution: Create a script named "scons" somewhere in
your $PATH (eg. ~/bin/scons will often work).
#!/bin/sh
python /C/Python27/Scripts/scons.py "${@}"
""" """
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals

View File

@@ -0,0 +1,339 @@
# Visual Studio 2015 Build Instructions
## Important
We do not recommend Windows for rippled production use at this time. Currently, the Ubuntu
platform has received the highest level of quality assurance, testing, and support.
## Prerequisites
To clone the source code repository, create branches for inspection or modification,
build rippled under Visual Studio, and run the unit tests you will need these
software components:
* [Visual Studio 2015](https://www.visualstudio.com/)
* [Git for Windows](http://git-scm.com/)
* [Google Protocol Buffers Compiler](https://code.google.com/p/protobuf/source/checkout)
* [OpenSSL Library](README.md#install-openssl)
* [ActivePerl](https://www.activestate.com/activeperl/downloads)
(Recommended to build OpenSSL.)
* [Boost 1.59 library](http://www.boost.org/users/download/)
* [Node.js](http://nodejs.org/download/)
Any version of Visual Studio 2015 may be used, including the Visual Studio Community
Edition which is available under a free license.
## Install Software
### Install Visual Studio 2015
If not already installed on your system, download your choice of installers from the
[Visual Studio 2015 Download](https://www.visualstudio.com/downloads/download-visual-studio-vs)
page, run the installer, and follow the directions.
The **Visual Studio 2015 Community** edition is available for free, while paid editions
may be used for an free initial trial period.
### Install Git for Windows
Git is a distributed revision control system. The Windows version also provides the
bash shell and many Windows versions of Unix commands. While there are other
varieties of Git (such as TortoiseGit, which has a native Windows interface and
integrates with the Explorer shell), we recommend installing
[Git for Windows](https://git-scm.com/) since
it provides a Unix-like command line environment useful for running shell scripts.
Use of the bash shell under Windows is mandatory for running the unit tests.
* NOTE: To gain full featured access to the
[git-subtree](https://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/)
functionality used in the rippled repository we suggest Git version 1.8.3.2 or later.
### Install Google Protocol Buffers Compiler
Building rippled requires **protoc.exe** version 2.5.1 or later. At your option you
may build it yourself from the sources in the
[Google Protocol Buffers](https://github.com/google/protobuf) repository,
or you may download a
[protoc.exe](https://ripple.github.io/Downloads/protoc/2.5.1/protoc.exe)
([alternate link](https://github.com/ripple/Downloads/raw/gh-pages/protoc/2.5.1/protoc.exe))
precompiled Windows executable from the
[Ripple Organization](https://github.com/ripple).
Either way, once you have the required version of **protoc.exe**, copy it into
a folder in your command line `%PATH%`.
* **NOTE:** If you use an older version of the compiler, the build will fail with
errors related to a mismatch of the version of protocol buffer headers versus
the compiler.
### Install ActivePerl
If not already installed on your system, download your choice of installers from the
[Activeperl Download](https://www.activestate.com/activeperl/downloads)
page, run the installer, and follow the directions.
## Configure Dependencies
### Install OpenSSL
1. Download OpenSSL *v1.0.2d or higher* source https://www.openssl.org/source/
2. Unpack the source archive into a temporary folder.
3. Open `cmd.exe`. Change the the folder where you unpacked OpenSSL.
4. Build the 64-bit libraries: (
[Reference 1](http://developer.covenanteyes.com/building-openssl-for-visual-studio/),
[Reference 2](http://www.p-nand-q.com/programming/windows/building_openssl_with_visual_studio_2013.html))
```powershell
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
perl Configure VC-WIN64A --prefix=C:\lib\openssl-VC-64
ms\do_win64a
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
copy tmp32\lib.pdb C:\lib\openssl-VC-64\lib\
```
5. Optionally, delete the temporary folder.
* NOTE: Since rippled links statically to OpenSSL, it does not matter where the OpenSSL
.DLL files are placed, or what version they are. rippled does not use or require any
external .DLL files to run other than the standard operating system ones.
### Build Boost
After downloading boost and unpacking it, open a **Developer Command Prompt** for
Visual Studio, change to the directory containing boost, then bootstrap the build tools:
```powershell
cd C:\lib\boost_1_59_0
bootstrap
```
The rippled application is linked statically to the standard runtimes and external
dependencies on Windows, to ensure that the behavior of the executable is not
affected by changes in outside files. Therefore, it is necessary to build the
required boost static libraries using this command:
```powershell
bjam --toolset=msvc-14.0 --build-type=complete variant=debug,release link=static runtime-link=static address-model=64
```
Building the boost libraries may take considerable time. When the build process
is completed, take note of both the reported compiler include paths and linker
library paths as they will be required later.
* NOTE: If older versions of Visual Studio are also installed, the build may fail.
If this happens, make sure that only Visual Studio 2015 is installed. Due to
defects in the uninstallation procedures of these Microsoft products, it may
be necessary to start with a fresh install of the operating system with only
the necessary development environment components installed to have a successful build.
### Clone the rippled repository
If you are familiar with cloning github repositories, just follow your normal process
and clone `git@github.com:ripple/rippled.git`. Otherwise follow this section for instructions.
1. If you don't have a github account, sign up for one at
[github.com](https://github.com/).
2. Make sure you have Github ssh keys. For help see
[generating-ssh-keys](https://help.github.com/articles/generating-ssh-keys).
Open the "Git Bash" shell that was installed with "Git for Windows" in the
step above. Navigate to the directory where you want to clone rippled (git
bash uses `/c` for windows's `C:` and forward slash where windows uses
backslash, so `C:\Users\joe\projs` would be `/c/Users/joe/projs` in git bash).
Now clone the repository and optionally switch to the *master* branch.
Type the following at the bash prompt:
```powershell
git clone git@github.com:ripple/rippled.git
cd rippled
git checkout master
```
* If you receive an error about not having the "correct access rights"
make sure you have Github ssh keys, as described above.
### Configure Library Paths
Open the solution file located at **Builds/Visual Studio 2015/ripple.sln**
and select the "View->Other Windows->Property Manager" to bring up the Property Manager.
Expand the *debug | x64* section (or similar section on 32-windows) and
double click the *Microsoft.Cpp.x64.user* property sheet to bring up the
*Property Pages* dialog (these sections will be called *Win32* instead of
*x64* on 32-bit windows). These are global properties applied to all
64-bit build targets:
![Visual Studio 2015 Global Properties](images/VS2015x64Properties.png)
Go to *C/C++, General, Additional Include Directories* and add the
location of the boost installation:
![Visual Studio 2015 Include Directories](images/VS2015x64IncludeDirs.png)
Then, go to *Linker, General, Additional Library Directories* and add
the location of the compiled boost libraries reported at the completion
of building the boost libraries:
![Visual Studio 2015 Library Directories](images/VS2015x64LibraryDirs.png)
Follow the same procedure for adding the `Additional Include Directories`
and `Additional Library Directories` required for OpenSSL. In our example
these directories are **C:\lib\openssl-VC-64\include** and
**C:\lib\openssl-VC-64\lib** respectively.
# Setup Environment
## Create a working directory for rippled.cfg
The rippled server uses the [Rippled.cfg](https://wiki.ripple.com/Rippled.cfg)
file to read its configuration parameters. This section describes setting up
a directory to hold the config file. The next sections describe how to tell
the rippled server where that file is.
1. Create a directory to hold the configuration file. In this example, the
ripple config directory was created in `C:\Users\joe\ripple\config`.
2. Copy the example config file located in `doc\rippled-example.cfg` to the
new directory and rename it "rippled.cfg".
3. Read the rippled.cfg file and edit as appropriate.
## Change the Visual Studio Projects Debugging Properties
1. If not already open, open the solution file located at **Builds/Visual Studio 2015/Ripple.sln**
2. Select the correct solution platform in the solution platform dropdown (either *x64*
or *Win32* depending on machine type).
3. Select the "Project->Properties" menu item to bring up RippleD's Properties Pages
4. In "Configuration Properties" select "Debugging".
5. In the upper-left Configurations drop down, select "All Configurations".
6. In "Debugger to Launch" select "Local Windows Debugger".
### Tell rippled where to find the configuration file.
The `--conf` command-line switch to tell rippled where to find this file.
In the "Command Arguments" field in the properties dialog (that you opened
in the above section), add: `--conf="C:/Users/joe/ripple/config/rippled.cfg"`
(of course replacing that path with the path you set up above).
![Visual Studio 2013 Command Args Prop Page](images/VSCommandArgsPropPage.png)
### Set the _NO_DEBUG_HEAP Environment Variable
Rippled can run very slowly in the debugger when using the Windows Debug Heap.
Set the `_NO_DEBUG_HEAP` environment variable to one to disable the debug heap.
In the "Environment" field (that you opened in the above section), add:
`_NO_DEBUG_HEAP=1`
![Visual Studio 2013 No Debug Heap Prop Page](images/NoDebugHeapPropPage.png)
# Build
After these steps are complete, rippled should be ready to build. Simply
set rippled as the startup project by right clicking on it in the
Visual Studio Solution Explorer, choose **Set as Startup Project**,
and then choose the **Build->Build Solution** menu item.
# Unit Tests (Recommended)
The external rippled unit tests are written in Javascript using Node.js,
and utilize the mocha unit test framework. To run the unit tests, it
will be necessary to perform the following steps:
## Install Node.js
[Install Node.js](http://nodejs.org/download/). We recommend the Windows
installer (**.msi** file) as it takes care of updating the *PATH* environment
variable so that scripts can find the command. On Windows systems,
**Node.js** comes with **npm**. A separate installation of **npm**
is not necessary.
## Create node_modules
Open a windows console. From the root of your local rippled repository
directory, invoke **npm** to bring in the necessary components:
```
npm install
```
If you get an error that looks like
```
Error: ENOENT, stat 'C:\Users\username\AppData\Roaming\npm'
```
simply create the indicated folder and try again.
## Create a test config.js
From a *bash* shell (installed with Git for Windows), copy the
example configuration file into the appropriate location:
```
cp test/config-example.js test/config.js
```
Edit your version of test/config.js to reflect the correct path to the rippled executable:
```
exports.default_server_config = {
// Where to find the binary.
rippled_path: path.resolve(__dirname, "../build/msvc.debug/rippled.exe")
};
```
Also in **test/config.js**, change any occurrences of the
IP address *0.0.0.0* to *127.0.0.1*.
## Run Tests
From a windows console, run the unit tests:
```
npm test
```
Alternatively, run an individual test using mocha:
```
sh
node_modules/mocha/bin/mocha test/account_tx-test.js
```
* NOTE: The version of ripple-lib provided by the npm install
facility is usually slightly behind the develop branch of the
authoritative ripple-lib repository. Therefore, some tests might fail.
## Development ripple-lib
To use the latest branch of **ripple-lib** during the unit tests,
first clone the repository in a new location outside of your rippled
repository. Then update the submodules. After, run **npm install**
to set up the **node_modules** directory. Finally, install the
**grunt** command line tools required to run **grunt** and
build **ripple-lib**.
```
git clone git@github.com:ripple/ripple-lib.git
cd ripple-lib
git submodule update --init
npm install
npm install -g grunt-cli
grunt
```
Now link this version of **ripple-lib** into the global packages:
```
sudo npm link
```
To make rippled use the newly linked global **ripple-lib** package
instead of the one installed under **node_modules**, change
directories to the local rippled repository and delete the old
**ripple-lib** then link to the new one:
```
sh
rm -rf node_modules/ripple-lib
npm link ripple-lib
```

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}</ProjectGuid> <ProjectGuid>{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
@@ -28,7 +28,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'" Label="Configuration">
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset> <PlatformToolset>v140</PlatformToolset>
<LinkIncremental>False</LinkIncremental> <LinkIncremental>False</LinkIncremental>
<UseDebugLibraries>False</UseDebugLibraries> <UseDebugLibraries>False</UseDebugLibraries>
<UseOfMfc>False</UseOfMfc> <UseOfMfc>False</UseOfMfc>
@@ -39,7 +39,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'" Label="Configuration">
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset> <PlatformToolset>v140</PlatformToolset>
<LinkIncremental>False</LinkIncremental> <LinkIncremental>False</LinkIncremental>
<UseDebugLibraries>False</UseDebugLibraries> <UseDebugLibraries>False</UseDebugLibraries>
<UseOfMfc>False</UseOfMfc> <UseOfMfc>False</UseOfMfc>
@@ -50,7 +50,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'" Label="Configuration">
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset> <PlatformToolset>v140</PlatformToolset>
<LinkIncremental>False</LinkIncremental> <LinkIncremental>False</LinkIncremental>
<UseDebugLibraries>False</UseDebugLibraries> <UseDebugLibraries>False</UseDebugLibraries>
<UseOfMfc>False</UseOfMfc> <UseOfMfc>False</UseOfMfc>
@@ -61,7 +61,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'" Label="Configuration">
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset> <PlatformToolset>v140</PlatformToolset>
<LinkIncremental>False</LinkIncremental> <LinkIncremental>False</LinkIncremental>
<UseDebugLibraries>False</UseDebugLibraries> <UseDebugLibraries>False</UseDebugLibraries>
<UseOfMfc>False</UseOfMfc> <UseOfMfc>False</UseOfMfc>
@@ -86,8 +86,8 @@
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>HAVE_USLEEP=1;_WIN32_WINNT=0x6000;DEBUG;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRTDBG_MAP_ALLOC;_CRT_SECURE_NO_WARNINGS;_DEBUG;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>HAVE_USLEEP=1;SOCI_CXX_C11=1;_WIN32_WINNT=0x6000;DEBUG;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRTDBG_MAP_ALLOC;_CRT_SECURE_NO_WARNINGS;_DEBUG;_SCL_SECURE_NO_WARNINGS;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\include;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4800;4244;4267;4018</DisableSpecificWarnings> <DisableSpecificWarnings>4800;4244;4267;4018</DisableSpecificWarnings>
<ExceptionHandling>Async</ExceptionHandling> <ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@@ -110,7 +110,7 @@
<AdditionalOptions>/bigobj /FS %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/bigobj /FS %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32MT.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32MT.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>True</SuppressStartupBanner> <SuppressStartupBanner>True</SuppressStartupBanner>
<ErrorReporting>NoErrorReport</ErrorReporting> <ErrorReporting>NoErrorReport</ErrorReporting>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
@@ -123,8 +123,8 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>HAVE_USLEEP=1;_WIN32_WINNT=0x6000;DEBUG;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRTDBG_MAP_ALLOC;_CRT_SECURE_NO_WARNINGS;_DEBUG;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>HAVE_USLEEP=1;SOCI_CXX_C11=1;_WIN32_WINNT=0x6000;DEBUG;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRTDBG_MAP_ALLOC;_CRT_SECURE_NO_WARNINGS;_DEBUG;_SCL_SECURE_NO_WARNINGS;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\include;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4800;4244;4267;4018</DisableSpecificWarnings> <DisableSpecificWarnings>4800;4244;4267;4018</DisableSpecificWarnings>
<ExceptionHandling>Async</ExceptionHandling> <ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@@ -147,7 +147,7 @@
<AdditionalOptions>/bigobj /FS %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/bigobj /FS %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32MT.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32MT.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>True</SuppressStartupBanner> <SuppressStartupBanner>True</SuppressStartupBanner>
<ErrorReporting>NoErrorReport</ErrorReporting> <ErrorReporting>NoErrorReport</ErrorReporting>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
@@ -160,8 +160,8 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>HAVE_USLEEP=1;_WIN32_WINNT=0x6000;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;NDEBUG;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>HAVE_USLEEP=1;SOCI_CXX_C11=1;_WIN32_WINNT=0x6000;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;NDEBUG;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\include;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4800;4244;4267;4018</DisableSpecificWarnings> <DisableSpecificWarnings>4800;4244;4267;4018</DisableSpecificWarnings>
<ExceptionHandling>Async</ExceptionHandling> <ExceptionHandling>Async</ExceptionHandling>
<FloatingPointModel>Precise</FloatingPointModel> <FloatingPointModel>Precise</FloatingPointModel>
@@ -182,7 +182,7 @@
<AdditionalOptions>/bigobj /FS %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/bigobj /FS %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32MT.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32MT.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>True</SuppressStartupBanner> <SuppressStartupBanner>True</SuppressStartupBanner>
<ErrorReporting>NoErrorReport</ErrorReporting> <ErrorReporting>NoErrorReport</ErrorReporting>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
@@ -195,8 +195,8 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>HAVE_USLEEP=1;_WIN32_WINNT=0x6000;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;NDEBUG;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>HAVE_USLEEP=1;SOCI_CXX_C11=1;_WIN32_WINNT=0x6000;DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;NDEBUG;OPENSSL_NO_SSL2;WIN32_CONSOLE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\..\build\proto;..\..\src;..\..\src\beast;..\..\src\protobuf\src;..\..\src\protobuf\vsprojects;..\..\src\soci\include;..\..\src\soci\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4800;4244;4267;4018</DisableSpecificWarnings> <DisableSpecificWarnings>4800;4244;4267;4018</DisableSpecificWarnings>
<ExceptionHandling>Async</ExceptionHandling> <ExceptionHandling>Async</ExceptionHandling>
<FloatingPointModel>Precise</FloatingPointModel> <FloatingPointModel>Precise</FloatingPointModel>
@@ -217,7 +217,7 @@
<AdditionalOptions>/bigobj /FS %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/bigobj /FS %(AdditionalOptions)</AdditionalOptions>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32MT.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32MT.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>advapi32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;libeay32.lib;odbc32.lib;odbccp32.lib;ole32.lib;oleaut32.lib;shell32.lib;Shlwapi.lib;ssleay32.lib;user32.lib;uuid.lib;winspool.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>True</SuppressStartupBanner> <SuppressStartupBanner>True</SuppressStartupBanner>
<ErrorReporting>NoErrorReport</ErrorReporting> <ErrorReporting>NoErrorReport</ErrorReporting>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
@@ -270,8 +270,6 @@
<ClCompile Include="..\..\src\beast\beast\asio\tests\streambuf.test.cpp"> <ClCompile Include="..\..\src\beast\beast\asio\tests\streambuf.test.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\beast\beast\asio\waitable_executor.h">
</ClInclude>
<ClCompile Include="..\..\src\beast\beast\boost\Boost.unity.cpp"> <ClCompile Include="..\..\src\beast\beast\boost\Boost.unity.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
@@ -1455,16 +1453,6 @@
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\app\ledger\PendingSaves.h"> <ClInclude Include="..\..\src\ripple\app\ledger\PendingSaves.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\ledger\tests\common_ledger.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\ripple\app\ledger\tests\common_ledger.h">
</ClInclude>
<ClCompile Include="..\..\src\ripple\app\ledger\tests\Ledger_test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\ledger\TransactionStateSF.cpp"> <ClCompile Include="..\..\src\ripple\app\ledger\TransactionStateSF.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
@@ -1541,7 +1529,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\app\misc\IHashRouter.h"> <ClInclude Include="..\..\src\ripple\app\misc\HashRouter.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\misc\impl\AccountTxPaging.cpp"> <ClCompile Include="..\..\src\ripple\app\misc\impl\AccountTxPaging.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
@@ -1565,14 +1553,6 @@
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\app\misc\SHAMapStoreImp.h"> <ClInclude Include="..\..\src\ripple\app\misc\SHAMapStoreImp.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\misc\tests\AccountTxPaging.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\misc\tests\AmendmentTable.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\misc\UniqueNodeList.cpp"> <ClCompile Include="..\..\src\ripple\app\misc\UniqueNodeList.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
@@ -1697,18 +1677,62 @@
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\app\paths\RippleState.h"> <ClInclude Include="..\..\src\ripple\app\paths\RippleState.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\paths\tests\Path_test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\ripple\app\paths\Tuning.h"> <ClInclude Include="..\..\src\ripple\app\paths\Tuning.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\app\paths\Types.h"> <ClInclude Include="..\..\src\ripple\app\paths\Types.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\tests\AccountTxPaging.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\AmendmentTable.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\CrossingLimits_test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\DeliverMin.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\MultiSign.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\Offer.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\OfferStream.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\OversizeMeta_test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\Path_test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\Regression_test.cpp"> <ClCompile Include="..\..\src\ripple\app\tests\Regression_test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\SetAuth_test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\SusPay_test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\Taker.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\ripple\app\tx\apply.h"> <ClInclude Include="..\..\src\ripple\app\tx\apply.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\tx\impl\apply.cpp"> <ClCompile Include="..\..\src\ripple\app\tx\impl\apply.cpp">
@@ -1809,6 +1833,12 @@
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\app\tx\impl\SignerEntries.h"> <ClInclude Include="..\..\src\ripple\app\tx\impl\SignerEntries.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\tx\impl\SusPay.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\ripple\app\tx\impl\SusPay.h">
</ClInclude>
<ClCompile Include="..\..\src\ripple\app\tx\impl\Taker.cpp"> <ClCompile Include="..\..\src\ripple\app\tx\impl\Taker.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
@@ -1837,32 +1867,6 @@
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\app\tx\LocalTxs.h"> <ClInclude Include="..\..\src\ripple\app\tx\LocalTxs.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\tx\tests\common_transactor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\ripple\app\tx\tests\common_transactor.h">
</ClInclude>
<ClCompile Include="..\..\src\ripple\app\tx\tests\DeliverMin.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tx\tests\MultiSign.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tx\tests\Offer.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tx\tests\OfferStream.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tx\tests\Taker.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\ripple\app\tx\Transaction.h"> <ClInclude Include="..\..\src\ripple\app\tx\Transaction.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\app\tx\TransactionAcquire.h"> <ClInclude Include="..\..\src\ripple\app\tx\TransactionAcquire.h">
@@ -2057,26 +2061,38 @@
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\core\impl\LoadFeeTrackImp.cpp"> <ClCompile Include="..\..\src\ripple\core\impl\LoadFeeTrack.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\core\impl\LoadFeeTrackImp.h">
</ClInclude>
<ClCompile Include="..\..\src\ripple\core\impl\LoadMonitor.cpp"> <ClCompile Include="..\..\src\ripple\core\impl\LoadMonitor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\core\impl\SNTPClock.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ClInclude Include="..\..\src\ripple\core\impl\SNTPClock.h">
</ClInclude>
<ClCompile Include="..\..\src\ripple\core\impl\SociDB.cpp"> <ClCompile Include="..\..\src\ripple\core\impl\SociDB.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\core\impl\TimeKeeper.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ClInclude Include="..\..\src\ripple\core\Job.h"> <ClInclude Include="..\..\src\ripple\core\Job.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\core\JobQueue.h"> <ClInclude Include="..\..\src\ripple\core\JobQueue.h">
@@ -2113,6 +2129,8 @@
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\core\TimeKeeper.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\crypto\Base58.h"> <ClInclude Include="..\..\src\ripple\crypto\Base58.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\crypto\Base58Data.h"> <ClInclude Include="..\..\src\ripple\crypto\Base58Data.h">
@@ -2121,8 +2139,6 @@
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\crypto\CBigNum.h"> <ClInclude Include="..\..\src\ripple\crypto\CBigNum.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\crypto\DHUtil.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\crypto\ECDSA.h"> <ClInclude Include="..\..\src\ripple\crypto\ECDSA.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\crypto\ECDSACanonical.h"> <ClInclude Include="..\..\src\ripple\crypto\ECDSACanonical.h">
@@ -2143,10 +2159,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\crypto\impl\DHUtil.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\crypto\impl\ECDSA.cpp"> <ClCompile Include="..\..\src\ripple\crypto\impl\ECDSA.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
@@ -2287,7 +2299,7 @@
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\ledger\CachedSLEs.h"> <ClInclude Include="..\..\src\ripple\ledger\CachedSLEs.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\ledger\CachingReadView.h"> <ClInclude Include="..\..\src\ripple\ledger\CachedView.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\ledger\detail\ApplyStateTable.h"> <ClInclude Include="..\..\src\ripple\ledger\detail\ApplyStateTable.h">
</ClInclude> </ClInclude>
@@ -2317,7 +2329,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\ledger\impl\CachingReadView.cpp"> <ClCompile Include="..\..\src\ripple\ledger\impl\CachedView.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
@@ -2337,6 +2349,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\ledger\impl\ReadView.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\ledger\impl\TxMeta.cpp"> <ClCompile Include="..\..\src\ripple\ledger\impl\TxMeta.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
@@ -2365,6 +2381,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\ledger\tests\SkipList_test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\ledger\tests\View_test.cpp"> <ClCompile Include="..\..\src\ripple\ledger\tests\View_test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
@@ -2401,10 +2421,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\net\impl\SNTPClient.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\ripple\net\InfoSub.h"> <ClInclude Include="..\..\src\ripple\net\InfoSub.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\net\RPCCall.h"> <ClInclude Include="..\..\src\ripple\net\RPCCall.h">
@@ -2413,8 +2429,6 @@
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\net\RPCSub.h"> <ClInclude Include="..\..\src\ripple\net\RPCSub.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\net\SNTPClient.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\nodestore\Backend.h"> <ClInclude Include="..\..\src\ripple\nodestore\Backend.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\nodestore\backend\MemoryFactory.cpp"> <ClCompile Include="..\..\src\ripple\nodestore\backend\MemoryFactory.cpp">
@@ -2707,10 +2721,6 @@
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\peerfinder\sim\Predicates.h"> <ClInclude Include="..\..\src\ripple\peerfinder\sim\Predicates.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\peerfinder\sim\Tests.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\ripple\peerfinder\sim\WrappedSink.h"> <ClInclude Include="..\..\src\ripple\peerfinder\sim\WrappedSink.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\peerfinder\Slot.h"> <ClInclude Include="..\..\src\ripple\peerfinder\Slot.h">
@@ -2733,6 +2743,8 @@
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\ErrorCodes.h"> <ClInclude Include="..\..\src\ripple\protocol\ErrorCodes.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\Feature.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\HashPrefix.h"> <ClInclude Include="..\..\src\ripple\protocol\HashPrefix.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\protocol\impl\AccountID.cpp"> <ClCompile Include="..\..\src\ripple\protocol\impl\AccountID.cpp">
@@ -2755,6 +2767,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\protocol\impl\Feature.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\protocol\impl\HashPrefix.cpp"> <ClCompile Include="..\..\src\ripple\protocol\impl\HashPrefix.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
@@ -2787,6 +2803,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\protocol\impl\Rate2.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\protocol\impl\RippleAddress.cpp"> <ClCompile Include="..\..\src\ripple\protocol\impl\RippleAddress.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
@@ -2909,6 +2929,8 @@
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\Quality.h"> <ClInclude Include="..\..\src\ripple\protocol\Quality.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\Rate.h">
</ClInclude>
<None Include="..\..\src\ripple\protocol\README.md"> <None Include="..\..\src\ripple\protocol\README.md">
</None> </None>
<ClInclude Include="..\..\src\ripple\protocol\RippleAddress.h"> <ClInclude Include="..\..\src\ripple\protocol\RippleAddress.h">
@@ -2927,6 +2949,8 @@
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\SOTemplate.h"> <ClInclude Include="..\..\src\ripple\protocol\SOTemplate.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\st.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\STAccount.h"> <ClInclude Include="..\..\src\ripple\protocol\STAccount.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\STAmount.h"> <ClInclude Include="..\..\src\ripple\protocol\STAmount.h">
@@ -3142,7 +3166,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\rpc\handlers\Feature.cpp"> <ClCompile Include="..\..\src\ripple\rpc\handlers\Feature1.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
@@ -3670,6 +3694,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\test\jtx\impl\tag.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\test\jtx\impl\ticket.cpp"> <ClCompile Include="..\..\src\ripple\test\jtx\impl\ticket.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
@@ -3720,6 +3748,8 @@
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\test\jtx\sig.h"> <ClInclude Include="..\..\src\ripple\test\jtx\sig.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\test\jtx\tag.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\test\jtx\tags.h"> <ClInclude Include="..\..\src\ripple\test\jtx\tags.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\test\jtx\ter.h"> <ClInclude Include="..\..\src\ripple\test\jtx\ter.h">
@@ -3851,22 +3881,24 @@
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\snappy\config;..\..\src\snappy\snappy;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\snappy\config;..\..\src\snappy\snappy;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\unity\soci.cpp"> <ClCompile Include="..\..\src\ripple\unity\soci.cpp">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\include\private;..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug|x64'">..\..\src\soci\include\private;..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\include\private;..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\soci\include\private;..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\unity\soci_ripple.cpp"> <ClCompile Include="..\..\src\ripple\unity\soci_ripple.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">True</ExcludedFromBuild>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug|x64'">..\..\src\soci\include\private;..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\soci\include\private;..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\unity\test.cpp"> <ClCompile Include="..\..\src\ripple\unity\test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\unity\validators.cpp"> <ClCompile Include="..\..\src\ripple\unity\unl.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\unity\websocket02.cpp"> <ClCompile Include="..\..\src\ripple\unity\websocket02.cpp">
</ClCompile> </ClCompile>
@@ -3876,37 +3908,32 @@
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\websocketpp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\websocketpp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\websocketpp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release|x64'">..\..\src\websocketpp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\validators\Connection.h"> <ClInclude Include="..\..\src\ripple\unl\tests\BasicNetwork.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\validators\impl\ConnectionImp.cpp"> <ClCompile Include="..\..\src\ripple\unl\tests\Consensus_test.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\validators\impl\ConnectionImp.h"> <ClInclude Include="..\..\src\ripple\unl\tests\metrics.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\validators\impl\Logic.cpp"> <ClCompile Include="..\..\src\ripple\unl\tests\Network_test.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\validators\impl\Logic.h"> <ClInclude Include="..\..\src\ripple\unl\tests\qalloc.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\validators\impl\Store.h"> <ClInclude Include="..\..\src\ripple\unl\tests\Sim1.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\validators\impl\StoreSqdb.cpp"> <ClInclude Include="..\..\src\ripple\unl\tests\Sim2.h">
<ExcludedFromBuild>True</ExcludedFromBuild> </ClInclude>
<ClInclude Include="..\..\src\ripple\unl\tests\Sim3.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\unl\tests\Sim4.h">
</ClInclude>
<ClCompile Include="..\..\src\ripple\unl\tests\SlotPeer_test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\validators\impl\StoreSqdb.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\validators\impl\Tuning.h">
</ClInclude>
<ClCompile Include="..\..\src\ripple\validators\impl\ValidatorManager.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\ripple\validators\make_Manager.h">
</ClInclude>
<ClCompile Include="..\..\src\ripple\validators\tests\Validators.test.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClInclude Include="..\..\src\ripple\validators\ValidatorManager.h">
</ClInclude>
<ClInclude Include="..\..\src\ripple\websocket\AutoSocket.h"> <ClInclude Include="..\..\src\ripple\websocket\AutoSocket.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\websocket\Config04.h"> <ClInclude Include="..\..\src\ripple\websocket\Config04.h">
@@ -4613,6 +4640,104 @@
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\snappy\snappy\snappy.h"> <ClInclude Include="..\..\src\snappy\snappy\snappy.h">
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\soci\include\private\soci-compiler.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\private\soci-cpp.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\private\soci-cstrtod.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\private\soci-dtocstr.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\private\soci-exchange-cast.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\private\soci-mktime.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\backend-loader.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\bind-values.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\blob-exchange.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\blob.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\boost-fusion.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\boost-gregorian-date.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\boost-optional.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\boost-tuple.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\connection-parameters.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\connection-pool.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\error.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\exchange-traits.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\into-type.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\into.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\noreturn.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\once-temp-type.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\prepare-temp-type.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\procedure.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\query_transformation.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\ref-counted-prepare-info.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\ref-counted-statement.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\row-exchange.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\row.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\rowid-exchange.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\rowid.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\rowset.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\session.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\soci-backend.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\soci-platform.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\soci-simple.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\soci.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\sqlite3\soci-sqlite3.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\statement.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\transaction.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\type-conversion-traits.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\type-conversion.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\type-holder.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\type-ptr.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\unsigned-types.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\use-type.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\use.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\values-exchange.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\values.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\blob.cpp"> <ClCompile Include="..\..\src\soci\src\backends\sqlite3\blob.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
@@ -4621,6 +4746,9 @@
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\backends\sqlite3\common.h"> <ClInclude Include="..\..\src\soci\src\backends\sqlite3\common.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\error.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\factory.cpp"> <ClCompile Include="..\..\src\soci\src\backends\sqlite3\factory.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
@@ -4630,8 +4758,6 @@
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\session.cpp"> <ClCompile Include="..\..\src\soci\src\backends\sqlite3\session.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\backends\sqlite3\soci-sqlite3.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\standard-into-type.cpp"> <ClCompile Include="..\..\src\soci\src\backends\sqlite3\standard-into-type.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
@@ -4647,144 +4773,60 @@
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\vector-use-type.cpp"> <ClCompile Include="..\..\src\soci\src\backends\sqlite3\vector-use-type.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\backend-loader.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\blob-exchange.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\blob.cpp"> <ClCompile Include="..\..\src\soci\src\core\blob.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\blob.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\boost-fusion.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\boost-gregorian-date.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\boost-optional.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\boost-tuple.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\connection-parameters.cpp"> <ClCompile Include="..\..\src\soci\src\core\connection-parameters.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\connection-parameters.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\connection-pool.cpp"> <ClCompile Include="..\..\src\soci\src\core\connection-pool.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\connection-pool.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\error.cpp"> <ClCompile Include="..\..\src\soci\src\core\error.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\error.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\exchange-traits.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\into-type.cpp"> <ClCompile Include="..\..\src\soci\src\core\into-type.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\into-type.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\into.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\once-temp-type.cpp"> <ClCompile Include="..\..\src\soci\src\core\once-temp-type.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\once-temp-type.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\prepare-temp-type.cpp"> <ClCompile Include="..\..\src\soci\src\core\prepare-temp-type.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\prepare-temp-type.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\procedure.cpp"> <ClCompile Include="..\..\src\soci\src\core\procedure.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\procedure.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\query_transformation.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\ref-counted-prepare-info.cpp"> <ClCompile Include="..\..\src\soci\src\core\ref-counted-prepare-info.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\ref-counted-prepare-info.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\ref-counted-statement.cpp"> <ClCompile Include="..\..\src\soci\src\core\ref-counted-statement.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\ref-counted-statement.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\row-exchange.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\row.cpp"> <ClCompile Include="..\..\src\soci\src\core\row.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\row.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\rowid-exchange.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\rowid.cpp"> <ClCompile Include="..\..\src\soci\src\core\rowid.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\rowid.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\rowset.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\session.cpp"> <ClCompile Include="..\..\src\soci\src\core\session.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\session.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\soci-backend.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\soci-config.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\soci-platform.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\soci-simple.cpp"> <ClCompile Include="..\..\src\soci\src\core\soci-simple.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\soci-simple.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\soci.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\statement.cpp"> <ClCompile Include="..\..\src\soci\src\core\statement.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\statement.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\transaction.cpp"> <ClCompile Include="..\..\src\soci\src\core\transaction.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\transaction.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\type-conversion-traits.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\type-conversion.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\type-holder.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\type-ptr.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\unsigned-types.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\use-type.cpp"> <ClCompile Include="..\..\src\soci\src\core\use-type.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\use-type.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\use.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\values-exchange.h">
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\values.cpp"> <ClCompile Include="..\..\src\soci\src\core\values.cpp">
<ExcludedFromBuild>True</ExcludedFromBuild> <ExcludedFromBuild>True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\values.h">
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\version.h">
</ClInclude>
<ClInclude Include="..\..\src\sqlite\sqlite.h"> <ClInclude Include="..\..\src\sqlite\sqlite.h">
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\sqlite\sqlite.unity.c"> <ClCompile Include="..\..\src\sqlite\sqlite.unity.c">

View File

@@ -250,9 +250,6 @@
<Filter Include="ripple\app\ledger\impl"> <Filter Include="ripple\app\ledger\impl">
<UniqueIdentifier>{0EF1A571-94CC-4D70-E004-48579DF8AF2B}</UniqueIdentifier> <UniqueIdentifier>{0EF1A571-94CC-4D70-E004-48579DF8AF2B}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="ripple\app\ledger\tests">
<UniqueIdentifier>{55A76B5B-A18E-E655-1A07-9492C6F8F356}</UniqueIdentifier>
</Filter>
<Filter Include="ripple\app\main"> <Filter Include="ripple\app\main">
<UniqueIdentifier>{91D5931B-D981-52BC-BC12-08DA9F7BF606}</UniqueIdentifier> <UniqueIdentifier>{91D5931B-D981-52BC-BC12-08DA9F7BF606}</UniqueIdentifier>
</Filter> </Filter>
@@ -262,18 +259,12 @@
<Filter Include="ripple\app\misc\impl"> <Filter Include="ripple\app\misc\impl">
<UniqueIdentifier>{C4BDB9F8-7DB7-E304-D286-098085D5D16E}</UniqueIdentifier> <UniqueIdentifier>{C4BDB9F8-7DB7-E304-D286-098085D5D16E}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="ripple\app\misc\tests">
<UniqueIdentifier>{815DC1A2-E2EF-E6E3-D979-19AD1476A28B}</UniqueIdentifier>
</Filter>
<Filter Include="ripple\app\paths"> <Filter Include="ripple\app\paths">
<UniqueIdentifier>{03533509-DAC6-636F-9F7E-288894549E95}</UniqueIdentifier> <UniqueIdentifier>{03533509-DAC6-636F-9F7E-288894549E95}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="ripple\app\paths\cursor"> <Filter Include="ripple\app\paths\cursor">
<UniqueIdentifier>{9AD8D049-10A8-704C-D51A-FAD55B1F235F}</UniqueIdentifier> <UniqueIdentifier>{9AD8D049-10A8-704C-D51A-FAD55B1F235F}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="ripple\app\paths\tests">
<UniqueIdentifier>{1025719B-6A8F-D9FB-A6BA-02B93756DE09}</UniqueIdentifier>
</Filter>
<Filter Include="ripple\app\tests"> <Filter Include="ripple\app\tests">
<UniqueIdentifier>{2E791662-6ED0-D1E1-03A4-0CB35473EC56}</UniqueIdentifier> <UniqueIdentifier>{2E791662-6ED0-D1E1-03A4-0CB35473EC56}</UniqueIdentifier>
</Filter> </Filter>
@@ -283,9 +274,6 @@
<Filter Include="ripple\app\tx\impl"> <Filter Include="ripple\app\tx\impl">
<UniqueIdentifier>{4849F8A8-26D5-8416-2D59-F4CA49F0100C}</UniqueIdentifier> <UniqueIdentifier>{4849F8A8-26D5-8416-2D59-F4CA49F0100C}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="ripple\app\tx\tests">
<UniqueIdentifier>{9F69C81C-840B-8296-2595-D669EC736BED}</UniqueIdentifier>
</Filter>
<Filter Include="ripple\basics"> <Filter Include="ripple\basics">
<UniqueIdentifier>{B8720E2F-21B1-2847-F96C-4E00A45DC639}</UniqueIdentifier> <UniqueIdentifier>{B8720E2F-21B1-2847-F96C-4E00A45DC639}</UniqueIdentifier>
</Filter> </Filter>
@@ -436,14 +424,11 @@
<Filter Include="ripple\unity"> <Filter Include="ripple\unity">
<UniqueIdentifier>{5DB3CD0B-B361-B301-9562-697CA8A52B68}</UniqueIdentifier> <UniqueIdentifier>{5DB3CD0B-B361-B301-9562-697CA8A52B68}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="ripple\validators"> <Filter Include="ripple\unl">
<UniqueIdentifier>{B23DCD4C-1622-2C31-4562-87F2F95D3884}</UniqueIdentifier> <UniqueIdentifier>{843C622F-AA52-E6C5-D3EB-D4B6D564B395}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="ripple\validators\impl"> <Filter Include="ripple\unl\tests">
<UniqueIdentifier>{3D1F0CBE-9B69-D29E-EAAE-E5A1204068BC}</UniqueIdentifier> <UniqueIdentifier>{2C910562-8D0A-B115-B829-556779436F2F}</UniqueIdentifier>
</Filter>
<Filter Include="ripple\validators\tests">
<UniqueIdentifier>{663AE0EE-6781-C2F4-8D04-0D5D30AC0773}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="ripple\websocket"> <Filter Include="ripple\websocket">
<UniqueIdentifier>{44780F86-42D3-2F2B-0846-5AEE2CA6D7FE}</UniqueIdentifier> <UniqueIdentifier>{44780F86-42D3-2F2B-0846-5AEE2CA6D7FE}</UniqueIdentifier>
@@ -532,6 +517,18 @@
<Filter Include="soci"> <Filter Include="soci">
<UniqueIdentifier>{E5334950-60C3-CE41-4DD7-535029F143F7}</UniqueIdentifier> <UniqueIdentifier>{E5334950-60C3-CE41-4DD7-535029F143F7}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="soci\include">
<UniqueIdentifier>{326BC235-4389-131A-EFCF-B54C652509F1}</UniqueIdentifier>
</Filter>
<Filter Include="soci\include\private">
<UniqueIdentifier>{95BB48F7-02FF-05FA-0112-506B0BB188FE}</UniqueIdentifier>
</Filter>
<Filter Include="soci\include\soci">
<UniqueIdentifier>{227F15C2-FEEE-AFD6-835C-989647DBEBE2}</UniqueIdentifier>
</Filter>
<Filter Include="soci\include\soci\sqlite3">
<UniqueIdentifier>{AEF95E82-C569-5213-CEFC-7546DD7CDD77}</UniqueIdentifier>
</Filter>
<Filter Include="soci\src"> <Filter Include="soci\src">
<UniqueIdentifier>{5A1D8022-39F2-67E1-FFBE-EA7D5BF9FBDB}</UniqueIdentifier> <UniqueIdentifier>{5A1D8022-39F2-67E1-FFBE-EA7D5BF9FBDB}</UniqueIdentifier>
</Filter> </Filter>
@@ -708,9 +705,6 @@
<ClCompile Include="..\..\src\beast\beast\asio\tests\streambuf.test.cpp"> <ClCompile Include="..\..\src\beast\beast\asio\tests\streambuf.test.cpp">
<Filter>beast\asio\tests</Filter> <Filter>beast\asio\tests</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\beast\beast\asio\waitable_executor.h">
<Filter>beast\asio</Filter>
</ClInclude>
<ClCompile Include="..\..\src\beast\beast\boost\Boost.unity.cpp"> <ClCompile Include="..\..\src\beast\beast\boost\Boost.unity.cpp">
<Filter>beast\boost</Filter> <Filter>beast\boost</Filter>
</ClCompile> </ClCompile>
@@ -2211,15 +2205,6 @@
<ClInclude Include="..\..\src\ripple\app\ledger\PendingSaves.h"> <ClInclude Include="..\..\src\ripple\app\ledger\PendingSaves.h">
<Filter>ripple\app\ledger</Filter> <Filter>ripple\app\ledger</Filter>
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\ledger\tests\common_ledger.cpp">
<Filter>ripple\app\ledger\tests</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\app\ledger\tests\common_ledger.h">
<Filter>ripple\app\ledger\tests</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ripple\app\ledger\tests\Ledger_test.cpp">
<Filter>ripple\app\ledger\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\ledger\TransactionStateSF.cpp"> <ClCompile Include="..\..\src\ripple\app\ledger\TransactionStateSF.cpp">
<Filter>ripple\app\ledger</Filter> <Filter>ripple\app\ledger</Filter>
</ClCompile> </ClCompile>
@@ -2295,7 +2280,7 @@
<ClCompile Include="..\..\src\ripple\app\misc\HashRouter.cpp"> <ClCompile Include="..\..\src\ripple\app\misc\HashRouter.cpp">
<Filter>ripple\app\misc</Filter> <Filter>ripple\app\misc</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\app\misc\IHashRouter.h"> <ClInclude Include="..\..\src\ripple\app\misc\HashRouter.h">
<Filter>ripple\app\misc</Filter> <Filter>ripple\app\misc</Filter>
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\misc\impl\AccountTxPaging.cpp"> <ClCompile Include="..\..\src\ripple\app\misc\impl\AccountTxPaging.cpp">
@@ -2322,12 +2307,6 @@
<ClInclude Include="..\..\src\ripple\app\misc\SHAMapStoreImp.h"> <ClInclude Include="..\..\src\ripple\app\misc\SHAMapStoreImp.h">
<Filter>ripple\app\misc</Filter> <Filter>ripple\app\misc</Filter>
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\misc\tests\AccountTxPaging.test.cpp">
<Filter>ripple\app\misc\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\misc\tests\AmendmentTable.test.cpp">
<Filter>ripple\app\misc\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\misc\UniqueNodeList.cpp"> <ClCompile Include="..\..\src\ripple\app\misc\UniqueNodeList.cpp">
<Filter>ripple\app\misc</Filter> <Filter>ripple\app\misc</Filter>
</ClCompile> </ClCompile>
@@ -2445,18 +2424,51 @@
<ClInclude Include="..\..\src\ripple\app\paths\RippleState.h"> <ClInclude Include="..\..\src\ripple\app\paths\RippleState.h">
<Filter>ripple\app\paths</Filter> <Filter>ripple\app\paths</Filter>
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\paths\tests\Path_test.cpp">
<Filter>ripple\app\paths\tests</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\app\paths\Tuning.h"> <ClInclude Include="..\..\src\ripple\app\paths\Tuning.h">
<Filter>ripple\app\paths</Filter> <Filter>ripple\app\paths</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\app\paths\Types.h"> <ClInclude Include="..\..\src\ripple\app\paths\Types.h">
<Filter>ripple\app\paths</Filter> <Filter>ripple\app\paths</Filter>
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\tests\AccountTxPaging.test.cpp">
<Filter>ripple\app\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\AmendmentTable.test.cpp">
<Filter>ripple\app\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\CrossingLimits_test.cpp">
<Filter>ripple\app\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\DeliverMin.test.cpp">
<Filter>ripple\app\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\MultiSign.test.cpp">
<Filter>ripple\app\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\Offer.test.cpp">
<Filter>ripple\app\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\OfferStream.test.cpp">
<Filter>ripple\app\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\OversizeMeta_test.cpp">
<Filter>ripple\app\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\Path_test.cpp">
<Filter>ripple\app\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\Regression_test.cpp"> <ClCompile Include="..\..\src\ripple\app\tests\Regression_test.cpp">
<Filter>ripple\app\tests</Filter> <Filter>ripple\app\tests</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\SetAuth_test.cpp">
<Filter>ripple\app\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\SusPay_test.cpp">
<Filter>ripple\app\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tests\Taker.test.cpp">
<Filter>ripple\app\tests</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\app\tx\apply.h"> <ClInclude Include="..\..\src\ripple\app\tx\apply.h">
<Filter>ripple\app\tx</Filter> <Filter>ripple\app\tx</Filter>
</ClInclude> </ClInclude>
@@ -2556,6 +2568,12 @@
<ClInclude Include="..\..\src\ripple\app\tx\impl\SignerEntries.h"> <ClInclude Include="..\..\src\ripple\app\tx\impl\SignerEntries.h">
<Filter>ripple\app\tx\impl</Filter> <Filter>ripple\app\tx\impl</Filter>
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\tx\impl\SusPay.cpp">
<Filter>ripple\app\tx\impl</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\app\tx\impl\SusPay.h">
<Filter>ripple\app\tx\impl</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ripple\app\tx\impl\Taker.cpp"> <ClCompile Include="..\..\src\ripple\app\tx\impl\Taker.cpp">
<Filter>ripple\app\tx\impl</Filter> <Filter>ripple\app\tx\impl</Filter>
</ClCompile> </ClCompile>
@@ -2583,27 +2601,6 @@
<ClInclude Include="..\..\src\ripple\app\tx\LocalTxs.h"> <ClInclude Include="..\..\src\ripple\app\tx\LocalTxs.h">
<Filter>ripple\app\tx</Filter> <Filter>ripple\app\tx</Filter>
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\app\tx\tests\common_transactor.cpp">
<Filter>ripple\app\tx\tests</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\app\tx\tests\common_transactor.h">
<Filter>ripple\app\tx\tests</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ripple\app\tx\tests\DeliverMin.test.cpp">
<Filter>ripple\app\tx\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tx\tests\MultiSign.test.cpp">
<Filter>ripple\app\tx\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tx\tests\Offer.test.cpp">
<Filter>ripple\app\tx\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tx\tests\OfferStream.test.cpp">
<Filter>ripple\app\tx\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\app\tx\tests\Taker.test.cpp">
<Filter>ripple\app\tx\tests</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\app\tx\Transaction.h"> <ClInclude Include="..\..\src\ripple\app\tx\Transaction.h">
<Filter>ripple\app\tx</Filter> <Filter>ripple\app\tx</Filter>
</ClInclude> </ClInclude>
@@ -2796,18 +2793,24 @@
<ClCompile Include="..\..\src\ripple\core\impl\LoadEvent.cpp"> <ClCompile Include="..\..\src\ripple\core\impl\LoadEvent.cpp">
<Filter>ripple\core\impl</Filter> <Filter>ripple\core\impl</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\core\impl\LoadFeeTrackImp.cpp"> <ClCompile Include="..\..\src\ripple\core\impl\LoadFeeTrack.cpp">
<Filter>ripple\core\impl</Filter> <Filter>ripple\core\impl</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\core\impl\LoadFeeTrackImp.h">
<Filter>ripple\core\impl</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ripple\core\impl\LoadMonitor.cpp"> <ClCompile Include="..\..\src\ripple\core\impl\LoadMonitor.cpp">
<Filter>ripple\core\impl</Filter> <Filter>ripple\core\impl</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\core\impl\SNTPClock.cpp">
<Filter>ripple\core\impl</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\core\impl\SNTPClock.h">
<Filter>ripple\core\impl</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ripple\core\impl\SociDB.cpp"> <ClCompile Include="..\..\src\ripple\core\impl\SociDB.cpp">
<Filter>ripple\core\impl</Filter> <Filter>ripple\core\impl</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\core\impl\TimeKeeper.cpp">
<Filter>ripple\core\impl</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\core\Job.h"> <ClInclude Include="..\..\src\ripple\core\Job.h">
<Filter>ripple\core</Filter> <Filter>ripple\core</Filter>
</ClInclude> </ClInclude>
@@ -2844,6 +2847,9 @@
<ClCompile Include="..\..\src\ripple\core\tests\SociDB.test.cpp"> <ClCompile Include="..\..\src\ripple\core\tests\SociDB.test.cpp">
<Filter>ripple\core\tests</Filter> <Filter>ripple\core\tests</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\core\TimeKeeper.h">
<Filter>ripple\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\crypto\Base58.h"> <ClInclude Include="..\..\src\ripple\crypto\Base58.h">
<Filter>ripple\crypto</Filter> <Filter>ripple\crypto</Filter>
</ClInclude> </ClInclude>
@@ -2856,9 +2862,6 @@
<ClInclude Include="..\..\src\ripple\crypto\CBigNum.h"> <ClInclude Include="..\..\src\ripple\crypto\CBigNum.h">
<Filter>ripple\crypto</Filter> <Filter>ripple\crypto</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\crypto\DHUtil.h">
<Filter>ripple\crypto</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\crypto\ECDSA.h"> <ClInclude Include="..\..\src\ripple\crypto\ECDSA.h">
<Filter>ripple\crypto</Filter> <Filter>ripple\crypto</Filter>
</ClInclude> </ClInclude>
@@ -2880,9 +2883,6 @@
<ClCompile Include="..\..\src\ripple\crypto\impl\CBigNum.cpp"> <ClCompile Include="..\..\src\ripple\crypto\impl\CBigNum.cpp">
<Filter>ripple\crypto\impl</Filter> <Filter>ripple\crypto\impl</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\crypto\impl\DHUtil.cpp">
<Filter>ripple\crypto\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\crypto\impl\ECDSA.cpp"> <ClCompile Include="..\..\src\ripple\crypto\impl\ECDSA.cpp">
<Filter>ripple\crypto\impl</Filter> <Filter>ripple\crypto\impl</Filter>
</ClCompile> </ClCompile>
@@ -3018,7 +3018,7 @@
<ClInclude Include="..\..\src\ripple\ledger\CachedSLEs.h"> <ClInclude Include="..\..\src\ripple\ledger\CachedSLEs.h">
<Filter>ripple\ledger</Filter> <Filter>ripple\ledger</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\ledger\CachingReadView.h"> <ClInclude Include="..\..\src\ripple\ledger\CachedView.h">
<Filter>ripple\ledger</Filter> <Filter>ripple\ledger</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\ledger\detail\ApplyStateTable.h"> <ClInclude Include="..\..\src\ripple\ledger\detail\ApplyStateTable.h">
@@ -3051,7 +3051,7 @@
<ClCompile Include="..\..\src\ripple\ledger\impl\CachedSLEs.cpp"> <ClCompile Include="..\..\src\ripple\ledger\impl\CachedSLEs.cpp">
<Filter>ripple\ledger\impl</Filter> <Filter>ripple\ledger\impl</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\ledger\impl\CachingReadView.cpp"> <ClCompile Include="..\..\src\ripple\ledger\impl\CachedView.cpp">
<Filter>ripple\ledger\impl</Filter> <Filter>ripple\ledger\impl</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\ledger\impl\Directory.cpp"> <ClCompile Include="..\..\src\ripple\ledger\impl\Directory.cpp">
@@ -3066,6 +3066,9 @@
<ClCompile Include="..\..\src\ripple\ledger\impl\RawStateTable.cpp"> <ClCompile Include="..\..\src\ripple\ledger\impl\RawStateTable.cpp">
<Filter>ripple\ledger\impl</Filter> <Filter>ripple\ledger\impl</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\ledger\impl\ReadView.cpp">
<Filter>ripple\ledger\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\ledger\impl\TxMeta.cpp"> <ClCompile Include="..\..\src\ripple\ledger\impl\TxMeta.cpp">
<Filter>ripple\ledger\impl</Filter> <Filter>ripple\ledger\impl</Filter>
</ClCompile> </ClCompile>
@@ -3096,6 +3099,9 @@
<ClCompile Include="..\..\src\ripple\ledger\tests\PaymentSandbox_test.cpp"> <ClCompile Include="..\..\src\ripple\ledger\tests\PaymentSandbox_test.cpp">
<Filter>ripple\ledger\tests</Filter> <Filter>ripple\ledger\tests</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\ledger\tests\SkipList_test.cpp">
<Filter>ripple\ledger\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\ledger\tests\View_test.cpp"> <ClCompile Include="..\..\src\ripple\ledger\tests\View_test.cpp">
<Filter>ripple\ledger\tests</Filter> <Filter>ripple\ledger\tests</Filter>
</ClCompile> </ClCompile>
@@ -3129,9 +3135,6 @@
<ClCompile Include="..\..\src\ripple\net\impl\RPCSub.cpp"> <ClCompile Include="..\..\src\ripple\net\impl\RPCSub.cpp">
<Filter>ripple\net\impl</Filter> <Filter>ripple\net\impl</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\net\impl\SNTPClient.cpp">
<Filter>ripple\net\impl</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\net\InfoSub.h"> <ClInclude Include="..\..\src\ripple\net\InfoSub.h">
<Filter>ripple\net</Filter> <Filter>ripple\net</Filter>
</ClInclude> </ClInclude>
@@ -3144,9 +3147,6 @@
<ClInclude Include="..\..\src\ripple\net\RPCSub.h"> <ClInclude Include="..\..\src\ripple\net\RPCSub.h">
<Filter>ripple\net</Filter> <Filter>ripple\net</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\net\SNTPClient.h">
<Filter>ripple\net</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\nodestore\Backend.h"> <ClInclude Include="..\..\src\ripple\nodestore\Backend.h">
<Filter>ripple\nodestore</Filter> <Filter>ripple\nodestore</Filter>
</ClInclude> </ClInclude>
@@ -3429,9 +3429,6 @@
<ClInclude Include="..\..\src\ripple\peerfinder\sim\Predicates.h"> <ClInclude Include="..\..\src\ripple\peerfinder\sim\Predicates.h">
<Filter>ripple\peerfinder\sim</Filter> <Filter>ripple\peerfinder\sim</Filter>
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\peerfinder\sim\Tests.cpp">
<Filter>ripple\peerfinder\sim</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\peerfinder\sim\WrappedSink.h"> <ClInclude Include="..\..\src\ripple\peerfinder\sim\WrappedSink.h">
<Filter>ripple\peerfinder\sim</Filter> <Filter>ripple\peerfinder\sim</Filter>
</ClInclude> </ClInclude>
@@ -3459,6 +3456,9 @@
<ClInclude Include="..\..\src\ripple\protocol\ErrorCodes.h"> <ClInclude Include="..\..\src\ripple\protocol\ErrorCodes.h">
<Filter>ripple\protocol</Filter> <Filter>ripple\protocol</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\Feature.h">
<Filter>ripple\protocol</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\HashPrefix.h"> <ClInclude Include="..\..\src\ripple\protocol\HashPrefix.h">
<Filter>ripple\protocol</Filter> <Filter>ripple\protocol</Filter>
</ClInclude> </ClInclude>
@@ -3477,6 +3477,9 @@
<ClCompile Include="..\..\src\ripple\protocol\impl\ErrorCodes.cpp"> <ClCompile Include="..\..\src\ripple\protocol\impl\ErrorCodes.cpp">
<Filter>ripple\protocol\impl</Filter> <Filter>ripple\protocol\impl</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\protocol\impl\Feature.cpp">
<Filter>ripple\protocol\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\protocol\impl\HashPrefix.cpp"> <ClCompile Include="..\..\src\ripple\protocol\impl\HashPrefix.cpp">
<Filter>ripple\protocol\impl</Filter> <Filter>ripple\protocol\impl</Filter>
</ClCompile> </ClCompile>
@@ -3501,6 +3504,9 @@
<ClCompile Include="..\..\src\ripple\protocol\impl\Quality.cpp"> <ClCompile Include="..\..\src\ripple\protocol\impl\Quality.cpp">
<Filter>ripple\protocol\impl</Filter> <Filter>ripple\protocol\impl</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\protocol\impl\Rate2.cpp">
<Filter>ripple\protocol\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\protocol\impl\RippleAddress.cpp"> <ClCompile Include="..\..\src\ripple\protocol\impl\RippleAddress.cpp">
<Filter>ripple\protocol\impl</Filter> <Filter>ripple\protocol\impl</Filter>
</ClCompile> </ClCompile>
@@ -3612,6 +3618,9 @@
<ClInclude Include="..\..\src\ripple\protocol\Quality.h"> <ClInclude Include="..\..\src\ripple\protocol\Quality.h">
<Filter>ripple\protocol</Filter> <Filter>ripple\protocol</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\Rate.h">
<Filter>ripple\protocol</Filter>
</ClInclude>
<None Include="..\..\src\ripple\protocol\README.md"> <None Include="..\..\src\ripple\protocol\README.md">
<Filter>ripple\protocol</Filter> <Filter>ripple\protocol</Filter>
</None> </None>
@@ -3639,6 +3648,9 @@
<ClInclude Include="..\..\src\ripple\protocol\SOTemplate.h"> <ClInclude Include="..\..\src\ripple\protocol\SOTemplate.h">
<Filter>ripple\protocol</Filter> <Filter>ripple\protocol</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\st.h">
<Filter>ripple\protocol</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\protocol\STAccount.h"> <ClInclude Include="..\..\src\ripple\protocol\STAccount.h">
<Filter>ripple\protocol</Filter> <Filter>ripple\protocol</Filter>
</ClInclude> </ClInclude>
@@ -3849,7 +3861,7 @@
<ClCompile Include="..\..\src\ripple\rpc\handlers\ConsensusInfo.cpp"> <ClCompile Include="..\..\src\ripple\rpc\handlers\ConsensusInfo.cpp">
<Filter>ripple\rpc\handlers</Filter> <Filter>ripple\rpc\handlers</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\rpc\handlers\Feature.cpp"> <ClCompile Include="..\..\src\ripple\rpc\handlers\Feature1.cpp">
<Filter>ripple\rpc\handlers</Filter> <Filter>ripple\rpc\handlers</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\rpc\handlers\FetchInfo.cpp"> <ClCompile Include="..\..\src\ripple\rpc\handlers\FetchInfo.cpp">
@@ -4341,6 +4353,9 @@
<ClCompile Include="..\..\src\ripple\test\jtx\impl\sig.cpp"> <ClCompile Include="..\..\src\ripple\test\jtx\impl\sig.cpp">
<Filter>ripple\test\jtx\impl</Filter> <Filter>ripple\test\jtx\impl</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\test\jtx\impl\tag.cpp">
<Filter>ripple\test\jtx\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\test\jtx\impl\ticket.cpp"> <ClCompile Include="..\..\src\ripple\test\jtx\impl\ticket.cpp">
<Filter>ripple\test\jtx\impl</Filter> <Filter>ripple\test\jtx\impl</Filter>
</ClCompile> </ClCompile>
@@ -4404,6 +4419,9 @@
<ClInclude Include="..\..\src\ripple\test\jtx\sig.h"> <ClInclude Include="..\..\src\ripple\test\jtx\sig.h">
<Filter>ripple\test\jtx</Filter> <Filter>ripple\test\jtx</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\test\jtx\tag.h">
<Filter>ripple\test\jtx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\test\jtx\tags.h"> <ClInclude Include="..\..\src\ripple\test\jtx\tags.h">
<Filter>ripple\test\jtx</Filter> <Filter>ripple\test\jtx</Filter>
</ClInclude> </ClInclude>
@@ -4527,7 +4545,7 @@
<ClCompile Include="..\..\src\ripple\unity\test.cpp"> <ClCompile Include="..\..\src\ripple\unity\test.cpp">
<Filter>ripple\unity</Filter> <Filter>ripple\unity</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\unity\validators.cpp"> <ClCompile Include="..\..\src\ripple\unity\unl.cpp">
<Filter>ripple\unity</Filter> <Filter>ripple\unity</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\unity\websocket02.cpp"> <ClCompile Include="..\..\src\ripple\unity\websocket02.cpp">
@@ -4536,45 +4554,36 @@
<ClCompile Include="..\..\src\ripple\unity\websocket04.cpp"> <ClCompile Include="..\..\src\ripple\unity\websocket04.cpp">
<Filter>ripple\unity</Filter> <Filter>ripple\unity</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\validators\Connection.h"> <ClInclude Include="..\..\src\ripple\unl\tests\BasicNetwork.h">
<Filter>ripple\validators</Filter> <Filter>ripple\unl\tests</Filter>
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\validators\impl\ConnectionImp.cpp"> <ClCompile Include="..\..\src\ripple\unl\tests\Consensus_test.cpp">
<Filter>ripple\validators\impl</Filter> <Filter>ripple\unl\tests</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\validators\impl\ConnectionImp.h"> <ClInclude Include="..\..\src\ripple\unl\tests\metrics.h">
<Filter>ripple\validators\impl</Filter> <Filter>ripple\unl\tests</Filter>
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\validators\impl\Logic.cpp"> <ClCompile Include="..\..\src\ripple\unl\tests\Network_test.cpp">
<Filter>ripple\validators\impl</Filter> <Filter>ripple\unl\tests</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\validators\impl\Logic.h"> <ClInclude Include="..\..\src\ripple\unl\tests\qalloc.h">
<Filter>ripple\validators\impl</Filter> <Filter>ripple\unl\tests</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\ripple\validators\impl\Store.h"> <ClInclude Include="..\..\src\ripple\unl\tests\Sim1.h">
<Filter>ripple\validators\impl</Filter> <Filter>ripple\unl\tests</Filter>
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\ripple\validators\impl\StoreSqdb.cpp"> <ClInclude Include="..\..\src\ripple\unl\tests\Sim2.h">
<Filter>ripple\validators\impl</Filter> <Filter>ripple\unl\tests</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\unl\tests\Sim3.h">
<Filter>ripple\unl\tests</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\unl\tests\Sim4.h">
<Filter>ripple\unl\tests</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ripple\unl\tests\SlotPeer_test.cpp">
<Filter>ripple\unl\tests</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\validators\impl\StoreSqdb.h">
<Filter>ripple\validators\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\validators\impl\Tuning.h">
<Filter>ripple\validators\impl</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ripple\validators\impl\ValidatorManager.cpp">
<Filter>ripple\validators\impl</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\validators\make_Manager.h">
<Filter>ripple\validators</Filter>
</ClInclude>
<ClCompile Include="..\..\src\ripple\validators\tests\Validators.test.cpp">
<Filter>ripple\validators\tests</Filter>
</ClCompile>
<ClInclude Include="..\..\src\ripple\validators\ValidatorManager.h">
<Filter>ripple\validators</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\websocket\AutoSocket.h"> <ClInclude Include="..\..\src\ripple\websocket\AutoSocket.h">
<Filter>ripple\websocket</Filter> <Filter>ripple\websocket</Filter>
</ClInclude> </ClInclude>
@@ -5466,6 +5475,153 @@
<ClInclude Include="..\..\src\snappy\snappy\snappy.h"> <ClInclude Include="..\..\src\snappy\snappy\snappy.h">
<Filter>snappy\snappy</Filter> <Filter>snappy\snappy</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\soci\include\private\soci-compiler.h">
<Filter>soci\include\private</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\private\soci-cpp.h">
<Filter>soci\include\private</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\private\soci-cstrtod.h">
<Filter>soci\include\private</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\private\soci-dtocstr.h">
<Filter>soci\include\private</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\private\soci-exchange-cast.h">
<Filter>soci\include\private</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\private\soci-mktime.h">
<Filter>soci\include\private</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\backend-loader.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\bind-values.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\blob-exchange.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\blob.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\boost-fusion.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\boost-gregorian-date.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\boost-optional.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\boost-tuple.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\connection-parameters.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\connection-pool.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\error.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\exchange-traits.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\into-type.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\into.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\noreturn.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\once-temp-type.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\prepare-temp-type.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\procedure.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\query_transformation.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\ref-counted-prepare-info.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\ref-counted-statement.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\row-exchange.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\row.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\rowid-exchange.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\rowid.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\rowset.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\session.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\soci-backend.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\soci-platform.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\soci-simple.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\soci.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\sqlite3\soci-sqlite3.h">
<Filter>soci\include\soci\sqlite3</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\statement.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\transaction.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\type-conversion-traits.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\type-conversion.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\type-holder.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\type-ptr.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\unsigned-types.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\use-type.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\use.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\values-exchange.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\include\soci\values.h">
<Filter>soci\include\soci</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\blob.cpp"> <ClCompile Include="..\..\src\soci\src\backends\sqlite3\blob.cpp">
<Filter>soci\src\backends\sqlite3</Filter> <Filter>soci\src\backends\sqlite3</Filter>
</ClCompile> </ClCompile>
@@ -5475,6 +5631,9 @@
<ClInclude Include="..\..\src\soci\src\backends\sqlite3\common.h"> <ClInclude Include="..\..\src\soci\src\backends\sqlite3\common.h">
<Filter>soci\src\backends\sqlite3</Filter> <Filter>soci\src\backends\sqlite3</Filter>
</ClInclude> </ClInclude>
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\error.cpp">
<Filter>soci\src\backends\sqlite3</Filter>
</ClCompile>
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\factory.cpp"> <ClCompile Include="..\..\src\soci\src\backends\sqlite3\factory.cpp">
<Filter>soci\src\backends\sqlite3</Filter> <Filter>soci\src\backends\sqlite3</Filter>
</ClCompile> </ClCompile>
@@ -5484,9 +5643,6 @@
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\session.cpp"> <ClCompile Include="..\..\src\soci\src\backends\sqlite3\session.cpp">
<Filter>soci\src\backends\sqlite3</Filter> <Filter>soci\src\backends\sqlite3</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\backends\sqlite3\soci-sqlite3.h">
<Filter>soci\src\backends\sqlite3</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\standard-into-type.cpp"> <ClCompile Include="..\..\src\soci\src\backends\sqlite3\standard-into-type.cpp">
<Filter>soci\src\backends\sqlite3</Filter> <Filter>soci\src\backends\sqlite3</Filter>
</ClCompile> </ClCompile>
@@ -5502,186 +5658,60 @@
<ClCompile Include="..\..\src\soci\src\backends\sqlite3\vector-use-type.cpp"> <ClCompile Include="..\..\src\soci\src\backends\sqlite3\vector-use-type.cpp">
<Filter>soci\src\backends\sqlite3</Filter> <Filter>soci\src\backends\sqlite3</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\backend-loader.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\blob-exchange.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\blob.cpp"> <ClCompile Include="..\..\src\soci\src\core\blob.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\blob.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\boost-fusion.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\boost-gregorian-date.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\boost-optional.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\boost-tuple.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\connection-parameters.cpp"> <ClCompile Include="..\..\src\soci\src\core\connection-parameters.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\connection-parameters.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\connection-pool.cpp"> <ClCompile Include="..\..\src\soci\src\core\connection-pool.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\connection-pool.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\error.cpp"> <ClCompile Include="..\..\src\soci\src\core\error.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\error.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\exchange-traits.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\into-type.cpp"> <ClCompile Include="..\..\src\soci\src\core\into-type.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\into-type.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\into.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\once-temp-type.cpp"> <ClCompile Include="..\..\src\soci\src\core\once-temp-type.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\once-temp-type.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\prepare-temp-type.cpp"> <ClCompile Include="..\..\src\soci\src\core\prepare-temp-type.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\prepare-temp-type.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\procedure.cpp"> <ClCompile Include="..\..\src\soci\src\core\procedure.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\procedure.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\query_transformation.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\ref-counted-prepare-info.cpp"> <ClCompile Include="..\..\src\soci\src\core\ref-counted-prepare-info.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\ref-counted-prepare-info.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\ref-counted-statement.cpp"> <ClCompile Include="..\..\src\soci\src\core\ref-counted-statement.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\ref-counted-statement.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\row-exchange.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\row.cpp"> <ClCompile Include="..\..\src\soci\src\core\row.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\row.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\rowid-exchange.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\rowid.cpp"> <ClCompile Include="..\..\src\soci\src\core\rowid.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\rowid.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\rowset.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\session.cpp"> <ClCompile Include="..\..\src\soci\src\core\session.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\session.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\soci-backend.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\soci-config.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\soci-platform.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\soci-simple.cpp"> <ClCompile Include="..\..\src\soci\src\core\soci-simple.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\soci-simple.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\soci.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\statement.cpp"> <ClCompile Include="..\..\src\soci\src\core\statement.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\statement.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\transaction.cpp"> <ClCompile Include="..\..\src\soci\src\core\transaction.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\transaction.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\type-conversion-traits.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\type-conversion.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\type-holder.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\type-ptr.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\unsigned-types.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\use-type.cpp"> <ClCompile Include="..\..\src\soci\src\core\use-type.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\use-type.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\use.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\values-exchange.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClCompile Include="..\..\src\soci\src\core\values.cpp"> <ClCompile Include="..\..\src\soci\src\core\values.cpp">
<Filter>soci\src\core</Filter> <Filter>soci\src\core</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\soci\src\core\values.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\soci\src\core\version.h">
<Filter>soci\src\core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\sqlite\sqlite.h"> <ClInclude Include="..\..\src\sqlite\sqlite.h">
<Filter>sqlite</Filter> <Filter>sqlite</Filter>
</ClInclude> </ClInclude>

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -1,9 +1,9 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2013 for Windows Desktop # Visual Studio 14
VisualStudioVersion = 12.0.31101.0 VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}") = "RippleD", "RippleD.vcxproj", "{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RippleD", "RippleD.vcxproj", "{26B7D9AC-1A80-8EF8-6703-D061F1BECB75}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@@ -1,14 +1,18 @@
%define rippled_branch %(echo $RIPPLED_BRANCH)
Name: rippled Name: rippled
Version: 0.29.0 # Version must be limited to MAJOR.MINOR.PATCH
Release: 1%{?dist} Version: 0.30.0
# Release should include either the build or hotfix number (ex: hf1%{?dist} or b2%{?dist})
# If there is no b# or hf#, then use 1%{?dist}
Release: %{?dist}
Summary: Ripple peer-to-peer network daemon Summary: Ripple peer-to-peer network daemon
Group: Applications/Internet Group: Applications/Internet
License: ISC License: ISC
URL: https://github.com/ripple/rippled URL: https://github.com/ripple/rippled
# curl -L -o SOURCES/rippled-release.zip https://github.com/ripple/rippled/archive/release.zip # curl -L -o SOURCES/rippled-release.zip https://github.com/ripple/rippled/archive/${RIPPLED_BRANCH}.zip
Source0: rippled-release.zip Source0: rippled-%{rippled_branch}.zip
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: gcc-c++ scons openssl-devel protobuf-devel BuildRequires: gcc-c++ scons openssl-devel protobuf-devel
@@ -20,13 +24,11 @@ Rippled is the server component of the Ripple network.
%prep %prep
%setup -n rippled-release %setup -n rippled-%{rippled_branch}
%build %build
# Assume boost is manually installed scons -j `grep -c processor /proc/cpuinfo`
export RIPPLED_BOOST_HOME=/usr/local/boost_1_55_0
scons -j `grep -c processor /proc/cpuinfo` build/rippled
%install %install
@@ -49,4 +51,4 @@ rm -rf %{buildroot}
%defattr(-,root,root,-) %defattr(-,root,root,-)
/usr/bin/rippled /usr/bin/rippled
/usr/share/rippled/LICENSE /usr/share/rippled/LICENSE
/etc/rippled/rippled-example.cfg %config(noreplace) /etc/rippled/rippled.cfg

View File

@@ -15,11 +15,13 @@
clang All clang variants clang All clang variants
clang.debug clang debug variant clang.debug clang debug variant
clang.coverage clang coverage variant
clang.release clang release variant clang.release clang release variant
clang.profile clang profile variant clang.profile clang profile variant
gcc All gcc variants gcc All gcc variants
gcc.debug gcc debug variant gcc.debug gcc debug variant
gcc.coverage gcc coverage variant
gcc.release gcc release variant gcc.release gcc release variant
gcc.profile gcc profile variant gcc.profile gcc profile variant
@@ -65,6 +67,19 @@ The following extra options may be used:
(see: https://martine.github.io/ninja/). Only gcc and clang targets (see: https://martine.github.io/ninja/). Only gcc and clang targets
are supported. are supported.
GCC 5 support: There is transitional support for user-installed gcc 5. Setting
the environment variable: `RIPPLED_OLD_GCC_ABI` to one enables the transitional
support. Due to an ABI change between gcc 4 and gcc 5, it is assumed all
libraries are built with the old, gcc 4 ABI. Since no linux distro has upgraded
to gcc 5, this allows us to use the package manager to install rippled
dependencies and to easily switch between gcc 4 and gcc 5. It also means if the
user builds C++ dependencies themselves - such as boost - they must either be
built with gcc 4 or with the preprocessor flag `_GLIBCXX_USE_CXX11_ABI` set to
zero. When linux distros upgrade to gcc 5, the transitional support will be
removed. To enable C++-14 support, define the environment variable `RIPPLED_USE_CPP_14`
to one. This is also transitional and will be removed when we permanently enable C++ 14
support.
''' '''
# #
''' '''
@@ -108,6 +123,7 @@ BUILD_TIME = 'Mon Apr 7 20:33:19 UTC 2014'
OPENSSL_ERROR = ('Your openSSL was built on %s; ' OPENSSL_ERROR = ('Your openSSL was built on %s; '
'rippled needs a version built on or after %s.') 'rippled needs a version built on or after %s.')
UNITY_BUILD_DIRECTORY = 'src/ripple/unity/' UNITY_BUILD_DIRECTORY = 'src/ripple/unity/'
USE_CPP_14 = os.getenv('RIPPLED_USE_CPP_14')
def check_openssl(): def check_openssl():
if Beast.system.platform in CHECK_PLATFORMS: if Beast.system.platform in CHECK_PLATFORMS:
@@ -250,6 +266,9 @@ def print_coms(target, source, env):
# TODO Add 'PROTOCCOM' to this list and make it work # TODO Add 'PROTOCCOM' to this list and make it work
Beast.print_coms(['CXXCOM', 'CCCOM', 'LINKCOM'], env) Beast.print_coms(['CXXCOM', 'CCCOM', 'LINKCOM'], env)
def is_debug_variant(variant):
return variant in ('debug', 'coverage')
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Set construction variables for the base environment # Set construction variables for the base environment
@@ -266,13 +285,22 @@ def config_base(env):
'OPENSSL_NO_SSL2' 'OPENSSL_NO_SSL2'
,'DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER' ,'DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER'
,{'HAVE_USLEEP' : '1'} ,{'HAVE_USLEEP' : '1'}
,{'SOCI_CXX_C11' : '1'}
,'_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS'
])
if USE_CPP_14:
env.Append(CPPDEFINES=[
'-DBEAST_NO_CXX14_COMPATIBILITY',
'-DBEAST_NO_CXX14_INTEGER_SEQUENCE',
'-DBEAST_NO_CXX14_MAKE_UNIQUE',
'-DBEAST_NO_CXX14_EQUAL',
'-DBOOST_NO_AUTO_PTR',
'-DBEAST_NO_CXX14_MAKE_REVERSE_ITERATOR',
]) ])
try: try:
BOOST_ROOT = os.path.normpath(os.environ['BOOST_ROOT']) BOOST_ROOT = os.path.normpath(os.environ['BOOST_ROOT'])
env.Append(CPPPATH=[
BOOST_ROOT,
])
env.Append(LIBPATH=[ env.Append(LIBPATH=[
os.path.join(BOOST_ROOT, 'stage', 'lib'), os.path.join(BOOST_ROOT, 'stage', 'lib'),
]) ])
@@ -287,7 +315,7 @@ def config_base(env):
os.path.join(OPENSSL_ROOT, 'include'), os.path.join(OPENSSL_ROOT, 'include'),
]) ])
env.Append(LIBPATH=[ env.Append(LIBPATH=[
os.path.join(OPENSSL_ROOT, 'lib', 'VC', 'static'), os.path.join(OPENSSL_ROOT, 'lib'),
]) ])
except KeyError: except KeyError:
pass pass
@@ -307,14 +335,31 @@ def config_base(env):
env.Append(CPPPATH=[os.path.join(profile_jemalloc, 'include')]) env.Append(CPPPATH=[os.path.join(profile_jemalloc, 'include')])
env.Append(LINKFLAGS=['-Wl,-rpath,' + os.path.join(profile_jemalloc, 'lib')]) env.Append(LINKFLAGS=['-Wl,-rpath,' + os.path.join(profile_jemalloc, 'lib')])
def gccStdLibDir():
try:
for l in subprocess.check_output(['gcc', '-v'], stderr=subprocess.STDOUT).split():
if l.startswith('--prefix'):
return l.split('=')[1] + '/lib64'
except:
pass
raise SCons.UserError('Could not find gccStdLibDir')
# Set toolchain and variant specific construction variables # Set toolchain and variant specific construction variables
def config_env(toolchain, variant, env): def config_env(toolchain, variant, env):
if variant == 'debug': if is_debug_variant(variant):
env.Append(CPPDEFINES=['DEBUG', '_DEBUG']) env.Append(CPPDEFINES=['DEBUG', '_DEBUG'])
elif variant == 'release' or variant == 'profile': elif variant == 'release' or variant == 'profile':
env.Append(CPPDEFINES=['NDEBUG']) env.Append(CPPDEFINES=['NDEBUG'])
if 'BOOST_ROOT' in env:
if toolchain == 'gcc':
env.Append(CCFLAGS=['-isystem' + env['BOOST_ROOT']])
else:
env.Append(CPPPATH=[
env['BOOST_ROOT'],
])
if toolchain in Split('clang gcc'): if toolchain in Split('clang gcc'):
if Beast.system.linux: if Beast.system.linux:
env.ParseConfig('pkg-config --static --cflags --libs openssl') env.ParseConfig('pkg-config --static --cflags --libs openssl')
@@ -351,7 +396,7 @@ def config_env(toolchain, variant, env):
env.Append(CXXFLAGS=[ env.Append(CXXFLAGS=[
'-frtti', '-frtti',
'-std=c++11', '-std=c++14' if USE_CPP_14 else '-std=c++11',
'-Wno-invalid-offsetof']) '-Wno-invalid-offsetof'])
env.Append(CPPDEFINES=['_FILE_OFFSET_BITS=64']) env.Append(CPPDEFINES=['_FILE_OFFSET_BITS=64'])
@@ -371,8 +416,24 @@ def config_env(toolchain, variant, env):
]) ])
else: else:
if toolchain == 'gcc': if toolchain == 'gcc':
if os.getenv('RIPPLED_OLD_GCC_ABI'):
gcc_ver = ''
try:
gcc_ver = subprocess.check_output(['gcc', '-dumpversion'],
stderr=subprocess.STDOUT).strip()
except:
pass
if gcc_ver.startswith('5'):
# remove rpath and CXX11_ABI flag when distro uses
# non-user installed gcc 5
env.Append(CPPDEFINES={
'-D_GLIBCXX_USE_CXX11_ABI' : 0
})
env.Append(LINKFLAGS=['-Wl,-rpath,' + gccStdLibDir()])
env.Append(CCFLAGS=[ env.Append(CCFLAGS=[
'-Wno-unused-but-set-variable' '-Wno-unused-but-set-variable',
'-Wno-deprecated',
]) ])
boost_libs = [ boost_libs = [
@@ -414,6 +475,12 @@ def config_env(toolchain, variant, env):
'-fno-strict-aliasing' '-fno-strict-aliasing'
]) ])
if variant == 'coverage':
env.Append(CXXFLAGS=[
'-fprofile-arcs', '-ftest-coverage'])
env.Append(LINKFLAGS=[
'-fprofile-arcs', '-ftest-coverage'])
if toolchain == 'clang': if toolchain == 'clang':
if Beast.system.osx: if Beast.system.osx:
env.Replace(CC='clang', CXX='clang++', LINK='clang++') env.Replace(CC='clang', CXX='clang++', LINK='clang++')
@@ -428,6 +495,8 @@ def config_env(toolchain, variant, env):
env.Append(CXXFLAGS=[ env.Append(CXXFLAGS=[
'-Wno-mismatched-tags', '-Wno-mismatched-tags',
'-Wno-deprecated-register', '-Wno-deprecated-register',
'-Wno-unused-local-typedefs',
'-Wno-unknown-warning-option',
]) ])
elif toolchain == 'gcc': elif toolchain == 'gcc':
@@ -441,7 +510,7 @@ def config_env(toolchain, variant, env):
# If we are in debug mode, use GCC-specific functionality to add # If we are in debug mode, use GCC-specific functionality to add
# extra error checking into the code (e.g. std::vector will throw # extra error checking into the code (e.g. std::vector will throw
# for out-of-bounds conditions) # for out-of-bounds conditions)
if variant == 'debug': if is_debug_variant(variant):
env.Append(CPPDEFINES={ env.Append(CPPDEFINES={
'_FORTIFY_SOURCE': 2 '_FORTIFY_SOURCE': 2
}) })
@@ -486,8 +555,8 @@ def config_env(toolchain, variant, env):
'WIN32_CONSOLE', 'WIN32_CONSOLE',
]) ])
env.Append(LIBS=[ env.Append(LIBS=[
'ssleay32MT.lib', 'ssleay32.lib',
'libeay32MT.lib', 'libeay32.lib',
'Shlwapi.lib', 'Shlwapi.lib',
'kernel32.lib', 'kernel32.lib',
'user32.lib', 'user32.lib',
@@ -553,13 +622,14 @@ base.Append(CPPPATH=[
os.path.join('src', 'beast'), os.path.join('src', 'beast'),
os.path.join(build_dir, 'proto'), os.path.join(build_dir, 'proto'),
os.path.join('src','soci','src'), os.path.join('src','soci','src'),
os.path.join('src','soci','include'),
]) ])
base.Decider('MD5-timestamp') base.Decider('MD5-timestamp')
set_implicit_cache() set_implicit_cache()
# Configure the toolchains, variants, default toolchain, and default target # Configure the toolchains, variants, default toolchain, and default target
variants = ['debug', 'release', 'profile'] variants = ['debug', 'coverage', 'release', 'profile']
all_toolchains = ['clang', 'gcc', 'msvc'] all_toolchains = ['clang', 'gcc', 'msvc']
if Beast.system.osx: if Beast.system.osx:
toolchains = ['clang'] toolchains = ['clang']
@@ -634,6 +704,7 @@ def get_soci_sources(style):
result = [] result = []
cpp_path = [ cpp_path = [
'src/soci/src/core', 'src/soci/src/core',
'src/soci/include/private',
'src/sqlite', ] 'src/sqlite', ]
append_sources(result, append_sources(result,
'src/ripple/unity/soci.cpp', 'src/ripple/unity/soci.cpp',
@@ -644,17 +715,20 @@ def get_soci_sources(style):
CPPPATH=cpp_path) CPPPATH=cpp_path)
return result return result
def get_common_sources(): def get_common_sources(toolchain):
result = [] result = []
if toolchain == 'msvc':
warning_flags = {}
else:
warning_flags = {'CCFLAGS': ['-Wno-unused-function']}
append_sources( append_sources(
result, result,
'src/ripple/unity/secp256k1.cpp', 'src/ripple/unity/secp256k1.cpp',
CPPPATH=[ CPPPATH=['src/secp256k1'],
'src/secp256k1', **warning_flags)
])
return result return result
def get_classic_sources(): def get_classic_sources(toolchain):
result = [] result = []
append_sources( append_sources(
result, result,
@@ -676,6 +750,7 @@ def get_classic_sources():
append_sources(result, *list_sources('src/ripple/rpc', '.cpp')) append_sources(result, *list_sources('src/ripple/rpc', '.cpp'))
append_sources(result, *list_sources('src/ripple/shamap', '.cpp')) append_sources(result, *list_sources('src/ripple/shamap', '.cpp'))
append_sources(result, *list_sources('src/ripple/test', '.cpp')) append_sources(result, *list_sources('src/ripple/test', '.cpp'))
append_sources(result, *list_sources('src/ripple/unl', '.cpp'))
append_sources( append_sources(
result, result,
@@ -687,11 +762,11 @@ def get_classic_sources():
]) ])
result += get_soci_sources('classic') result += get_soci_sources('classic')
result += get_common_sources() result += get_common_sources(toolchain)
return result return result
def get_unity_sources(): def get_unity_sources(toolchain):
result = [] result = []
append_sources( append_sources(
result, result,
@@ -713,6 +788,7 @@ def get_unity_sources():
'src/ripple/unity/rpcx.cpp', 'src/ripple/unity/rpcx.cpp',
'src/ripple/unity/shamap.cpp', 'src/ripple/unity/shamap.cpp',
'src/ripple/unity/test.cpp', 'src/ripple/unity/test.cpp',
'src/ripple/unity/unl.cpp',
) )
append_sources( append_sources(
@@ -725,7 +801,7 @@ def get_unity_sources():
]) ])
result += get_soci_sources('unity') result += get_soci_sources('unity')
result += get_common_sources() result += get_common_sources(toolchain)
return result return result
@@ -789,15 +865,11 @@ def should_build_ninja(style, toolchain, variant):
return False return False
for tu_style in ['classic', 'unity']: for tu_style in ['classic', 'unity']:
if tu_style == 'classic':
sources = get_classic_sources()
else:
sources = get_unity_sources()
for toolchain in all_toolchains: for toolchain in all_toolchains:
for variant in variants: for variant in variants:
if not should_prepare_targets(tu_style, toolchain, variant): if not should_prepare_targets(tu_style, toolchain, variant):
continue continue
if variant == 'profile' and toolchain == 'msvc': if variant in ['profile', 'coverage'] and toolchain == 'msvc':
continue continue
# Configure this variant's construction environment # Configure this variant's construction environment
env = base.Clone() env = base.Clone()
@@ -817,6 +889,10 @@ for tu_style in ['classic', 'unity']:
object_builder = ObjectBuilder(env, variant_dirs) object_builder = ObjectBuilder(env, variant_dirs)
if tu_style == 'classic':
sources = get_classic_sources(toolchain)
else:
sources = get_unity_sources(toolchain)
for s, k in sources: for s, k in sources:
object_builder.add_source_files(*s, **k) object_builder.add_source_files(*s, **k)
@@ -840,7 +916,6 @@ for tu_style in ['classic', 'unity']:
'src/ripple/unity/ripple.proto.cpp', 'src/ripple/unity/ripple.proto.cpp',
'src/ripple/unity/resource.cpp', 'src/ripple/unity/resource.cpp',
'src/ripple/unity/server.cpp', 'src/ripple/unity/server.cpp',
'src/ripple/unity/validators.cpp',
'src/ripple/unity/websocket02.cpp' 'src/ripple/unity/websocket02.cpp'
) )
@@ -926,7 +1001,7 @@ for key, value in aliases.iteritems():
env.Alias(key, value) env.Alias(key, value)
vcxproj = base.VSProject( vcxproj = base.VSProject(
os.path.join('Builds', 'VisualStudio2013', 'RippleD'), os.path.join('Builds', 'VisualStudio2015', 'RippleD'),
source = [], source = [],
VSPROJECT_ROOT_DIRS = ['src/beast', 'src', '.'], VSPROJECT_ROOT_DIRS = ['src/beast', 'src', '.'],
VSPROJECT_CONFIGS = msvc_configs) VSPROJECT_CONFIGS = msvc_configs)

View File

@@ -6,20 +6,22 @@ environment:
# that it's a small download. We also use appveyor's free cache, avoiding fees # that it's a small download. We also use appveyor's free cache, avoiding fees
# downloading from S3 each time. # downloading from S3 each time.
# TODO: script to create this package. # TODO: script to create this package.
RIPPLED_DEPS_URL: https://s3-ap-northeast-1.amazonaws.com/history-replay/rippled_deps.zip RIPPLED_DEPS_URL: https://github.com/ripple/Downloads/blob/gh-pages/appveyor/rippled_deps15.zip?raw=true
# Other dependencies we just download each time. # Other dependencies we just download each time.
PIP_URL: https://bootstrap.pypa.io/get-pip.py PIP_URL: https://bootstrap.pypa.io/get-pip.py
PYWIN32_URL: https://downloads.sourceforge.net/project/pywin32/pywin32/Build%20219/pywin32-219.win-amd64-py2.7.exe PYWIN32_URL: https://downloads.sourceforge.net/project/pywin32/pywin32/Build%20219/pywin32-219.win-amd64-py2.7.exe
# Scons honours these environment variables, setting the include/lib paths. # Scons honours these environment variables, setting the include/lib paths.
BOOST_ROOT: C:/rippled_deps/boost BOOST_ROOT: C:/rippled_deps15/boost
OPENSSL_ROOT: C:/rippled_deps/openssl OPENSSL_ROOT: C:/rippled_deps15/openssl
os: Visual Studio 2015
# At the end of each successful build we cache this directory. It must be less # At the end of each successful build we cache this directory. It must be less
# than 100MB total compressed. # than 100MB total compressed.
cache: cache:
- "C:\\rippled_deps" - "C:\\rippled_deps15"
# This means we'll download a zip of the branch we want, rather than the full # This means we'll download a zip of the branch we want, rather than the full
# history. # history.
@@ -27,7 +29,7 @@ shallow_clone: true
install: install:
# We want easy_install, python and protoc.exe on PATH. # We want easy_install, python and protoc.exe on PATH.
- SET PATH=%PYTHON%;%PYTHON%/Scripts;C:/rippled_deps;%PATH% - SET PATH=%PYTHON%;%PYTHON%/Scripts;C:/rippled_deps15;%PATH%
# `ps` prefix means the command is executed by powershell. # `ps` prefix means the command is executed by powershell.
- ps: Start-FileDownload $env:PIP_URL - ps: Start-FileDownload $env:PIP_URL
@@ -46,9 +48,17 @@ install:
# Download dependencies if appveyor didn't restore them from the cache. # Download dependencies if appveyor didn't restore them from the cache.
# Use 7zip to unzip. # Use 7zip to unzip.
- ps: | - ps: |
if (-not(Test-Path 'C:/rippled_deps')) { if (-not(Test-Path 'C:/rippled_deps15')) {
echo "Download from $env:RIPPLED_DEPS_URL"
Start-FileDownload "$env:RIPPLED_DEPS_URL" Start-FileDownload "$env:RIPPLED_DEPS_URL"
7z x rippled_deps.zip -oC:\ -y > $null 7z x rippled_deps15.zip -oC:\ -y > $null
}
# Newer DEPS include a versions file.
# Dump it so we can verify correct behavior.
- ps: |
if (Test-Path 'C:/rippled_deps15/versions.txt') {
cat 'C:/rippled_deps15/versions.txt'
} }
# TODO: This is giving me grief # TODO: This is giving me grief
@@ -58,7 +68,7 @@ install:
build_script: build_script:
# We set the environment variables needed to put compilers on the PATH. # We set the environment variables needed to put compilers on the PATH.
- '"%VS120COMNTOOLS%../../VC/vcvarsall.bat" x86_amd64' - '"%VS140COMNTOOLS%../../VC/vcvarsall.bat" x86_amd64'
# Show which version of the compiler we are using. # Show which version of the compiler we are using.
- cl - cl
- scons msvc.debug -j%NUMBER_OF_PROCESSORS% - scons msvc.debug -j%NUMBER_OF_PROCESSORS%

36
bin/ci/ubuntu/build-and-test.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash -u
# We use set -e and bash with -u to bail on first non zero exit code of any
# processes launched or upon any unbound variable
set -e
__dirname=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
echo "using CC: $CC"
echo "using TARGET: $TARGET"
export RIPPLED_PATH="$PWD/build/$CC.$TARGET/rippled"
echo "using RIPPLED_PATH: $RIPPLED_PATH"
# Make sure vcxproj is up to date
scons vcxproj
git diff --exit-code
# $CC will be either `clang` or `gcc`
# http://docs.travis-ci.com/user/migrating-from-legacy/?utm_source=legacy-notice&utm_medium=banner&utm_campaign=legacy-upgrade
# indicates that 2 cores are available to containers.
scons -j${NUM_PROCESSORS:-2} $CC.$TARGET
# We can be sure we're using the build/$CC.$TARGET variant
# (-f so never err)
rm -f build/rippled
# See what we've actually built
ldd $RIPPLED_PATH
if [[ $TARGET == "coverage" ]]; then
$RIPPLED_PATH --unittest
# We pass along -p to keep path segments so as to avoid collisions
codecov --gcov-args=-p --gcov-source-match='^src/(ripple|beast)'
else
# Run unittests (under gdb)
cat $__dirname/unittests.gdb | gdb \
--return-child-result \
--args $RIPPLED_PATH --unittest
fi
# Run NPM tests
npm install
npm test --rippled=$RIPPLED_PATH

View File

@@ -0,0 +1,25 @@
#!/bin/bash -u
# Exit if anything fails.
set -e
# Override gcc version to $GCC_VER.
# Put an appropriate symlink at the front of the path.
mkdir -v $HOME/bin
for g in gcc g++ gcov gcc-ar gcc-nm gcc-ranlib
do
test -x $( type -p ${g}-$GCC_VER )
ln -sv $(type -p ${g}-$GCC_VER) $HOME/bin/${g}
done
export PATH=$PWD/bin:$PATH
# What versions are we ACTUALLY running?
g++ -v
clang -v
# Avoid `spurious errors` caused by ~/.npm permission issues
# Does it already exist? Who owns? What permissions?
ls -lah ~/.npm || mkdir ~/.npm
# Make sure we own it
chown -Rc $USER ~/.npm
# We use this so we can filter the subtrees from our coverage report
pip install --user https://github.com/sublimator/codecov-python/zipball/source-match
bash bin/sh/install-boost.sh

View File

@@ -0,0 +1,4 @@
set env MALLOC_CHECK_=3
set print thread-events off
run
backtrace full

22
bin/sh/install-boost.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
# Assumptions:
# 1) BOOST_ROOT and BOOST_URL are already defined,
# and contain valid values.
# 2) The last namepart of BOOST_ROOT matches the
# folder name internal to boost's .tar.gz
# When testing you can force a boost build by clearing travis caches:
# https://travis-ci.org/ripple/rippled/caches
set -e
if [ ! -d "$BOOST_ROOT/lib" ]
then
wget $BOOST_URL -O /tmp/boost.tar.gz
cd `dirname $BOOST_ROOT`
rm -fr ${BOOST_ROOT}
tar xzf /tmp/boost.tar.gz
cd $BOOST_ROOT && \
./bootstrap.sh --prefix=$BOOST_ROOT && \
./b2 -d1 define=_GLIBCXX_USE_CXX11_ABI=0 && ./b2 -d0 define=_GLIBCXX_USE_CXX11_ABI=0 install
else
echo "Using cached boost at $BOOST_ROOT"
fi

View File

@@ -26,3 +26,4 @@ A list of rippled version numbers, and the Github pull requests they contain.
0.28.2-b7: Includes pulls 1077, 1080, 1086, 1095, 1098, 1106 and 1112. 0.28.2-b7: Includes pulls 1077, 1080, 1086, 1095, 1098, 1106 and 1112.
0.28.2-b8: Includes pulls 1078, 1100, 1108, 1114, 1118, 1119 and 1121. 0.28.2-b8: Includes pulls 1078, 1100, 1108, 1114, 1118, 1119 and 1121.
0.28.2-b9: Includes pulls 1053, 1109, 1111, 1117, 1122 and 1123. 0.28.2-b9: Includes pulls 1053, 1109, 1111, 1117, 1122 and 1123.
0.29.1-b11: Includes pulls 1279, 1271, 1289, 1291, 1290, 1267, 1294, 1276, 1231, and 1286.

View File

@@ -359,38 +359,18 @@
# #
# #
# #
# [overlay] EXPERIMENTAL # [overlay]
# #
# This section is EXPERIMENTAL, and should not be # Controls settings related to the peer to peer overlay.
# present for production configuration settings.
# #
# A set of key/value pair parameters to configure the overlay. # A set of key/value pair parameters to configure the overlay.
# #
# auto_connect = 0 | 1 # public_ip = <IP-address>
#
# When set, activates the autoconnect feature. This maintains outgoing
# connections using PeerFinder's "Outgoing Connection Strategy."
#
# become_superpeer = 'never' | 'always' | 'auto'
#
# Controls the selection of peer roles:
#
# 'never' Always handshake in the leaf role.
# 'always' Always handshake in the superpeer role.
# 'auto' Start as a leaf, promote to superpeer after
# passing capability check (default).
#
# In the leaf role, a peer does not advertise its IP and port for
# the purpose of receiving incoming connections. The peer also does
# not forward transactions and validations received from other peers.
#
# In the superpeer role, a peer advertises its IP and port for
# receiving incoming connections after passing an incoming connection
# test. Superpeers forward transactions and protocol messages to all
# other peers. Superpeers do not forward validations to other superpeers.
# Instead, a validation received by a superpeer from a leaf is forwarded
# only to other leaf connections.
# #
# If the server has a known, fixed public IPv4 address,
# specify that IP address here in dotted decimal notation.
# Peers will use this information to reject attempt to proxy
# connections to or from this server.
# #
# #
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------

View File

@@ -7,19 +7,18 @@
"test": "test" "test": "test"
}, },
"dependencies": { "dependencies": {
"assert-diff": "^1.0.1",
"async": "~0.2.9", "async": "~0.2.9",
"babel": "^5.8.21",
"coffee-script": "^1.8.0",
"deep-equal": "0.0.0", "deep-equal": "0.0.0",
"extend": "~1.2.0", "extend": "~1.2.0",
"lodash": "^3.5.0", "lodash": "^3.5.0",
"mocha": "^2.1.0",
"request": "^2.47.0", "request": "^2.47.0",
"ripple-lib": "0.10.0", "ripple-lib": "0.13.0-rc6.0",
"simple-jsonrpc": "~0.0.2" "simple-jsonrpc": "~0.0.2"
}, },
"devDependencies": {
"assert-diff": "^1.0.1",
"coffee-script": "^1.8.0",
"mocha": "^2.1.0"
},
"scripts": { "scripts": {
"test": "mocha test/websocket-test.js test/server-test.js test/*-test.{js,coffee}" "test": "mocha test/websocket-test.js test/server-test.js test/*-test.{js,coffee}"
}, },

View File

@@ -164,13 +164,6 @@
#define RIPPLE_SINGLE_IO_SERVICE_THREAD 0 #define RIPPLE_SINGLE_IO_SERVICE_THREAD 0
#endif #endif
/** Config: RIPPLE_HOOK_VALIDATORS
Activates code for handling validations and validators (work in progress).
*/
#ifndef RIPPLE_HOOK_VALIDATORS
#define RIPPLE_HOOK_VALIDATORS 0
#endif
/** Config: RIPPLE_ENABLE_TICKETS /** Config: RIPPLE_ENABLE_TICKETS
Enables processing of ticket transactions Enables processing of ticket transactions
*/ */
@@ -178,23 +171,9 @@
#define RIPPLE_ENABLE_TICKETS 0 #define RIPPLE_ENABLE_TICKETS 0
#endif #endif
/** Config: RIPPLE_ENABLE_MULTI_SIGN
When set, activates the current state of the multi-sign feature which is
under development. When the feature is complete and released this
#define should be removed.
*/
#ifndef RIPPLE_ENABLE_MULTI_SIGN
#define RIPPLE_ENABLE_MULTI_SIGN 0
#endif
// Uses OpenSSL instead of alternatives // Uses OpenSSL instead of alternatives
#ifndef RIPPLE_USE_OPENSSL #ifndef RIPPLE_USE_OPENSSL
#define RIPPLE_USE_OPENSSL 0 #define RIPPLE_USE_OPENSSL 0
#endif #endif
// Enables the experimental OpenLedger
#ifndef RIPPLE_OPEN_LEDGER
#define RIPPLE_OPEN_LEDGER 0
#endif
#endif #endif

View File

@@ -69,12 +69,6 @@ public:
/** Returns the current time. */ /** Returns the current time. */
virtual time_point now() const = 0; virtual time_point now() const = 0;
/** Returning elapsed ticks since the epoch. */
rep elapsed() const
{
return now().time_since_epoch().count();
}
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@@ -50,7 +50,9 @@
// Disables beast's std::equal safe iterator overloads // Disables beast's std::equal safe iterator overloads
#ifndef BEAST_NO_CXX14_EQUAL #ifndef BEAST_NO_CXX14_EQUAL
# ifdef _MSC_VER # if defined(_MSC_VER) && _MSC_VER >= 1900
# define BEAST_NO_CXX14_EQUAL 1
# elif defined(_MSC_VER)
# define BEAST_NO_CXX14_EQUAL 0 # define BEAST_NO_CXX14_EQUAL 0
# elif defined(__clang__) && defined(_LIBCPP_VERSION) && __cplusplus >= 201402 # elif defined(__clang__) && defined(_LIBCPP_VERSION) && __cplusplus >= 201402
# define BEAST_NO_CXX14_EQUAL 1 # define BEAST_NO_CXX14_EQUAL 1
@@ -61,7 +63,9 @@
// Disables beast's std::integer_sequence // Disables beast's std::integer_sequence
#ifndef BEAST_NO_CXX14_INTEGER_SEQUENCE #ifndef BEAST_NO_CXX14_INTEGER_SEQUENCE
# ifdef _MSC_VER # if defined(_MSC_VER) && _MSC_VER >= 1900
# define BEAST_NO_CXX14_INTEGER_SEQUENCE 1
# elif defined(_MSC_VER)
# define BEAST_NO_CXX14_INTEGER_SEQUENCE 0 # define BEAST_NO_CXX14_INTEGER_SEQUENCE 0
# elif defined(__clang__) && defined(_LIBCPP_VERSION) && __cplusplus >= 201402 # elif defined(__clang__) && defined(_LIBCPP_VERSION) && __cplusplus >= 201402
# define BEAST_NO_CXX14_INTEGER_SEQUENCE 1 # define BEAST_NO_CXX14_INTEGER_SEQUENCE 1
@@ -72,7 +76,9 @@
// Disables beast's std::make_reverse_iterator // Disables beast's std::make_reverse_iterator
#ifndef BEAST_NO_CXX14_MAKE_REVERSE_ITERATOR #ifndef BEAST_NO_CXX14_MAKE_REVERSE_ITERATOR
# ifdef _MSC_VER # if defined(_MSC_VER) && _MSC_VER >= 1900
# define BEAST_NO_CXX14_MAKE_REVERSE_ITERATOR 1
# elif defined(_MSC_VER)
# define BEAST_NO_CXX14_MAKE_REVERSE_ITERATOR 0 # define BEAST_NO_CXX14_MAKE_REVERSE_ITERATOR 0
# elif defined(__clang__) && defined(_LIBCPP_VERSION) && __cplusplus >= 201402 # elif defined(__clang__) && defined(_LIBCPP_VERSION) && __cplusplus >= 201402
# define BEAST_NO_CXX14_MAKE_REVERSE_ITERATOR 1 # define BEAST_NO_CXX14_MAKE_REVERSE_ITERATOR 1

View File

@@ -26,6 +26,7 @@
#endif #endif
//============================================================================== //==============================================================================
#include <beast/module/core/native/BasicNativeHeaders.h> #include <beast/module/core/native/BasicNativeHeaders.h>
#include <beast/module/core/core.h> #include <beast/module/core/core.h>
@@ -46,7 +47,10 @@
#include <ws2tcpip.h> #include <ws2tcpip.h>
#if ! BEAST_MINGW #if ! BEAST_MINGW
#pragma warning ( push )
#pragma warning ( disable: 4091 )
#include <Dbghelp.h> #include <Dbghelp.h>
#pragma warning ( pop )
#if ! BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES #if ! BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES
#pragma comment (lib, "DbgHelp.lib") #pragma comment (lib, "DbgHelp.lib")

View File

@@ -106,7 +106,10 @@
#include <mapi.h> #include <mapi.h>
#include <float.h> #include <float.h>
#include <process.h> #include <process.h>
#pragma warning ( push )
#pragma warning ( disable: 4091 )
#include <shlobj.h> #include <shlobj.h>
#pragma warning ( pop )
#include <shlwapi.h> #include <shlwapi.h>
#include <mmsystem.h> #include <mmsystem.h>

View File

@@ -117,7 +117,7 @@ public:
capacity off the block, so that its length matches the amount of actual data that capacity off the block, so that its length matches the amount of actual data that
has been written so far. has been written so far.
*/ */
void flush(); void flush() override;
bool write (const void*, size_t) override; bool write (const void*, size_t) override;
std::int64_t getPosition() override { return position; } std::int64_t getPosition() override { return position; }

View File

@@ -147,8 +147,7 @@ bool is_public (AddressV4 const& addr)
{ {
return return
! is_private (addr) && ! is_private (addr) &&
! is_multicast (addr) && ! is_multicast (addr);
(addr != AddressV4::broadcast (addr));
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@@ -62,6 +62,7 @@ private:
} }
}; };
public:
// Memberspace // Memberspace
class log_t class log_t
{ {
@@ -80,6 +81,7 @@ private:
abstract_ostream& abstract_ostream&
stream(); stream();
}; };
private:
class scoped_testcase; class scoped_testcase;
@@ -176,6 +178,48 @@ public:
return expect (shouldBeTrue, ""); return expect (shouldBeTrue, "");
} }
/** Expect an exception from f() */
/** @{ */
template <class F, class String>
bool
except (F&& f, String const& reason);
template <class F>
bool
except (F&& f)
{
return except(f, "");
}
/** @} */
/** Expect an exception of the given type from f() */
/** @{ */
template <class E, class F, class String>
bool
except (F&& f, String const& reason);
template <class E, class F>
bool
except (F&& f)
{
return except<E>(f, "");
}
/** @} */
/** Fail if f() throws */
/** @{ */
template <class F, class String>
bool
unexcept (F&& f, String const& reason);
template <class F>
bool
unexcept (F&& f)
{
return unexcept(f, "");
}
/** @} */
/** Return the argument associated with the runner. */ /** Return the argument associated with the runner. */
std::string const& std::string const&
arg() const arg() const
@@ -355,6 +399,57 @@ suite::expect (Condition shouldBeTrue,
return b; return b;
} }
template <class F, class String>
bool
suite::except (F&& f, String const& reason)
{
try
{
f();
fail(reason);
return false;
}
catch(...)
{
pass();
}
return true;
}
template <class E, class F, class String>
bool
suite::except (F&& f, String const& reason)
{
try
{
f();
fail(reason);
return false;
}
catch(E const&)
{
pass();
}
return true;
}
template <class F, class String>
bool
suite::unexcept (F&& f, String const& reason)
{
try
{
f();
pass();
return true;
}
catch(...)
{
fail(reason);
}
return false;
}
template <class Condition, class String> template <class Condition, class String>
inline inline
bool bool

View File

@@ -69,17 +69,17 @@ public:
} }
beast::Journal::Severity beast::Journal::Severity
severity() const severity() const override
{ {
return sink_.severity(); return sink_.severity();
} }
void severity (beast::Journal::Severity level) void severity (beast::Journal::Severity level) override
{ {
sink_.severity (level); sink_.severity (level);
} }
void write (beast::Journal::Severity level, std::string const& text) void write (beast::Journal::Severity level, std::string const& text) override
{ {
using beast::Journal; using beast::Journal;
sink_.write (level, prefix_ + text); sink_.write (level, prefix_ + text);

View File

@@ -25,10 +25,12 @@
#define BEAST_UTILITY_NOEXCEPT_H_INCLUDED #define BEAST_UTILITY_NOEXCEPT_H_INCLUDED
#ifdef _MSC_VER #ifdef _MSC_VER
# if _MSC_VER < 1900
# ifdef noexcept # ifdef noexcept
# undef noexcept # undef noexcept
# endif # endif
# define noexcept throw() # define noexcept throw()
# endif
# if _MSC_VER > 1600 && ! _ALLOW_KEYWORD_MACROS # if _MSC_VER > 1600 && ! _ALLOW_KEYWORD_MACROS
# define _ALLOW_KEYWORD_MACROS 1 // (to stop VC2012 complaining) # define _ALLOW_KEYWORD_MACROS 1 // (to stop VC2012 complaining)
# endif # endif

View File

@@ -158,7 +158,7 @@ static_initializer_test::test (cxx11_tag)
t(counts); t(counts);
}); });
#ifdef _MSC_VER #if defined(_MSC_VER) && _MSC_VER < 1900
// Visual Studio 2013 and earlier can exhibit both double // Visual Studio 2013 and earlier can exhibit both double
// construction, and access before construction when function // construction, and access before construction when function
// local statics are initialized concurrently. // local statics are initialized concurrently.

View File

@@ -30,19 +30,19 @@ import SCons.Util
UnicodeByteMarker = '\xEF\xBB\xBF' UnicodeByteMarker = '\xEF\xBB\xBF'
V12DSPHeader = """\ V14DSPHeader = """\
<?xml version="1.0" encoding="%(encoding)s"?>\r <?xml version="1.0" encoding="%(encoding)s"?>\r
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
""" """
V12DSPProjectConfiguration = """\ V14DSPProjectConfiguration = """\
<ProjectConfiguration Include="%(variant)s|%(platform)s">\r <ProjectConfiguration Include="%(variant)s|%(platform)s">\r
<Configuration>%(variant)s</Configuration>\r <Configuration>%(variant)s</Configuration>\r
<Platform>%(platform)s</Platform>\r <Platform>%(platform)s</Platform>\r
</ProjectConfiguration>\r </ProjectConfiguration>\r
""" """
V12DSPGlobals = """\ V14DSPGlobals = """\
<PropertyGroup Label="Globals">\r <PropertyGroup Label="Globals">\r
<ProjectGuid>%(project_guid)s</ProjectGuid>\r <ProjectGuid>%(project_guid)s</ProjectGuid>\r
<Keyword>Win32Proj</Keyword>\r <Keyword>Win32Proj</Keyword>\r
@@ -51,11 +51,11 @@ V12DSPGlobals = """\
</PropertyGroup>\r </PropertyGroup>\r
""" """
V12DSPPropertyGroup = """\ V14DSPPropertyGroup = """\
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'" Label="Configuration">\r <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'" Label="Configuration">\r
<CharacterSet>MultiByte</CharacterSet>\r <CharacterSet>MultiByte</CharacterSet>\r
<ConfigurationType>Application</ConfigurationType>\r <ConfigurationType>Application</ConfigurationType>\r
<PlatformToolset>v120</PlatformToolset>\r <PlatformToolset>v140</PlatformToolset>\r
<LinkIncremental>False</LinkIncremental>\r <LinkIncremental>False</LinkIncremental>\r
<UseDebugLibraries>%(use_debug_libs)s</UseDebugLibraries>\r <UseDebugLibraries>%(use_debug_libs)s</UseDebugLibraries>\r
<UseOfMfc>False</UseOfMfc>\r <UseOfMfc>False</UseOfMfc>\r
@@ -65,17 +65,17 @@ V12DSPPropertyGroup = """\
</PropertyGroup>\r </PropertyGroup>\r
""" """
V12DSPImportGroup= """\ V14DSPImportGroup= """\
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'" Label="PropertySheets">\r <ImportGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'" Label="PropertySheets">\r
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
</ImportGroup>\r </ImportGroup>\r
""" """
V12DSPItemDefinitionGroup= """\ V14DSPItemDefinitionGroup= """\
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">\r <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='%(variant)s|%(platform)s'">\r
""" """
V12CustomBuildProtoc= """\ V14CustomBuildProtoc= """\
<FileType>Document</FileType>\r <FileType>Document</FileType>\r
<Command Condition="'$(Configuration)|$(Platform)'=='%(name)s'">protoc --cpp_out=%(cpp_out)s --proto_path=%%(RelativeDir) %%(Identity)</Command>\r <Command Condition="'$(Configuration)|$(Platform)'=='%(name)s'">protoc --cpp_out=%(cpp_out)s --proto_path=%%(RelativeDir) %%(Identity)</Command>\r
<Outputs Condition="'$(Configuration)|$(Platform)'=='%(name)s'">%(base_out)s.pb.h;%(base_out)s.pb.cc</Outputs>\r <Outputs Condition="'$(Configuration)|$(Platform)'=='%(name)s'">%(base_out)s.pb.h;%(base_out)s.pb.cc</Outputs>\r
@@ -83,7 +83,7 @@ V12CustomBuildProtoc= """\
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='%(name)s'">false</LinkObjects>\r <LinkObjects Condition="'$(Configuration)|$(Platform)'=='%(name)s'">false</LinkObjects>\r
""" """
V12DSPFiltersHeader = ( V14DSPFiltersHeader = (
'''<?xml version="1.0" encoding="utf-8"?>\r '''<?xml version="1.0" encoding="utf-8"?>\r
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
''') ''')
@@ -663,13 +663,13 @@ class _ProjectGenerator(object):
f = self.project_file f = self.project_file
f.write(UnicodeByteMarker) f.write(UnicodeByteMarker)
f.write(V12DSPHeader % locals()) f.write(V14DSPHeader % locals())
f.write(V12DSPGlobals % locals()) f.write(V14DSPGlobals % locals())
f.write(' <ItemGroup Label="ProjectConfigurations">\r\n') f.write(' <ItemGroup Label="ProjectConfigurations">\r\n')
for config in self.configs: for config in self.configs:
variant = config.variant variant = config.variant
platform = config.platform platform = config.platform
f.write(V12DSPProjectConfiguration % locals()) f.write(V14DSPProjectConfiguration % locals())
f.write(' </ItemGroup>\r\n') f.write(' </ItemGroup>\r\n')
f.write(' <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r\n') f.write(' <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r\n')
@@ -681,20 +681,20 @@ class _ProjectGenerator(object):
config.target[0].get_abspath()), self.project_dir) config.target[0].get_abspath()), self.project_dir)
out_dir = winpath(variant_dir) + ntpath.sep out_dir = winpath(variant_dir) + ntpath.sep
int_dir = winpath(ntpath.join(variant_dir, 'src')) + ntpath.sep int_dir = winpath(ntpath.join(variant_dir, 'src')) + ntpath.sep
f.write(V12DSPPropertyGroup % locals()) f.write(V14DSPPropertyGroup % locals())
f.write(' <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r\n') f.write(' <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r\n')
f.write(' <ImportGroup Label="ExtensionSettings" />\r\n') f.write(' <ImportGroup Label="ExtensionSettings" />\r\n')
for config in self.configs: for config in self.configs:
variant = config.variant variant = config.variant
platform = config.platform platform = config.platform
f.write(V12DSPImportGroup % locals()) f.write(V14DSPImportGroup % locals())
f.write(' <PropertyGroup Label="UserMacros" />\r\n') f.write(' <PropertyGroup Label="UserMacros" />\r\n')
for config in self.configs: for config in self.configs:
variant = config.variant variant = config.variant
platform = config.platform platform = config.platform
f.write(V12DSPItemDefinitionGroup % locals()) f.write(V14DSPItemDefinitionGroup % locals())
# Cl options # Cl options
f.write(' <ClCompile>\r\n') f.write(' <ClCompile>\r\n')
f.write( f.write(
@@ -759,7 +759,7 @@ class _ProjectGenerator(object):
out_parts = out_dir.split(os.sep) out_parts = out_dir.split(os.sep)
out_parts.append(os.path.splitext(os.path.basename(item.path()))[0]) out_parts.append(os.path.splitext(os.path.basename(item.path()))[0])
base_out = ntpath.join(*out_parts) base_out = ntpath.join(*out_parts)
props += V12CustomBuildProtoc % locals() props += V14CustomBuildProtoc % locals()
f.write(' <%(tag)s Include="%(path)s">\r\n' % locals()) f.write(' <%(tag)s Include="%(path)s">\r\n' % locals())
f.write(props) f.write(props)
@@ -783,7 +783,7 @@ class _ProjectGenerator(object):
f = self.filters_file f = self.filters_file
f.write(UnicodeByteMarker) f.write(UnicodeByteMarker)
f.write(V12DSPFiltersHeader) f.write(V14DSPFiltersHeader)
f.write(' <ItemGroup>\r\n') f.write(' <ItemGroup>\r\n')
groups = set() groups = set()

View File

@@ -24,35 +24,18 @@
namespace ripple { namespace ripple {
// VFALCO TODO Remove this global and make it a member of the App AcceptedLedger::AcceptedLedger (
// Use a dependency injection to give AcceptedLedger access. std::shared_ptr<ReadView const> const& ledger,
// AccountIDCache const& accountCache, Logs& logs)
TaggedCache <uint256, AcceptedLedger> AcceptedLedger::s_cache ( : mLedger (ledger)
"AcceptedLedger", 4, 60, stopwatch(),
deprecatedLogs().journal("TaggedCache"));
AcceptedLedger::AcceptedLedger (Ledger::ref ledger) : mLedger (ledger)
{ {
for (auto const& item : ledger->txMap()) for (auto const& item : ledger->txs)
{ {
SerialIter sit (item.slice());
insert (std::make_shared<AcceptedLedgerTx>( insert (std::make_shared<AcceptedLedgerTx>(
ledger, std::ref (sit))); ledger, item.first, item.second, accountCache, logs));
} }
} }
AcceptedLedger::pointer AcceptedLedger::makeAcceptedLedger (Ledger::ref ledger)
{
AcceptedLedger::pointer ret = s_cache.fetch (ledger->getHash());
if (ret)
return ret;
ret = AcceptedLedger::pointer (new AcceptedLedger (ledger));
s_cache.canonicalize (ledger->getHash (), ret);
return ret;
}
void AcceptedLedger::insert (AcceptedLedgerTx::ref at) void AcceptedLedger::insert (AcceptedLedgerTx::ref at)
{ {
assert (mMap.find (at->getIndex ()) == mMap.end ()); assert (mMap.find (at->getIndex ()) == mMap.end ());

View File

@@ -21,6 +21,7 @@
#define RIPPLE_APP_LEDGER_ACCEPTEDLEDGER_H_INCLUDED #define RIPPLE_APP_LEDGER_ACCEPTEDLEDGER_H_INCLUDED
#include <ripple/app/ledger/AcceptedLedgerTx.h> #include <ripple/app/ledger/AcceptedLedgerTx.h>
#include <ripple/protocol/AccountID.h>
namespace ripple { namespace ripple {
@@ -45,18 +46,13 @@ class AcceptedLedger
public: public:
using pointer = std::shared_ptr<AcceptedLedger>; using pointer = std::shared_ptr<AcceptedLedger>;
using ret = const pointer&; using ret = const pointer&;
using map_t = std::map<int, AcceptedLedgerTx::pointer>; // Must be an ordered map! using map_t = std::map<int, AcceptedLedgerTx::pointer>;
// mapt_t must be an ordered map!
using value_type = map_t::value_type; using value_type = map_t::value_type;
using const_iterator = map_t::const_iterator; using const_iterator = map_t::const_iterator;
public: public:
static pointer makeAcceptedLedger (Ledger::ref ledger); std::shared_ptr<ReadView const> const& getLedger () const
static void sweep ()
{
s_cache.sweep ();
}
Ledger::ref getLedger () const
{ {
return mLedger; return mLedger;
} }
@@ -70,22 +66,16 @@ public:
return mMap.size (); return mMap.size ();
} }
static float getCacheHitRate ()
{
return s_cache.getHitRate ();
}
AcceptedLedgerTx::pointer getTxn (int) const; AcceptedLedgerTx::pointer getTxn (int) const;
private: AcceptedLedger (
explicit AcceptedLedger (Ledger::ref ledger); std::shared_ptr<ReadView const> const& ledger,
AccountIDCache const& accountCache, Logs& logs);
private:
void insert (AcceptedLedgerTx::ref); void insert (AcceptedLedgerTx::ref);
private: std::shared_ptr<ReadView const> mLedger;
static TaggedCache <uint256, AcceptedLedger> s_cache;
Ledger::pointer mLedger;
map_t mMap; map_t mMap;
}; };

View File

@@ -20,46 +20,52 @@
#include <BeastConfig.h> #include <BeastConfig.h>
#include <ripple/app/main/Application.h> #include <ripple/app/main/Application.h>
#include <ripple/app/ledger/AcceptedLedgerTx.h> #include <ripple/app/ledger/AcceptedLedgerTx.h>
#include <ripple/basics/Log.h>
#include <ripple/basics/StringUtilities.h> #include <ripple/basics/StringUtilities.h>
#include <ripple/protocol/JsonFields.h> #include <ripple/protocol/JsonFields.h>
#include <ripple/protocol/types.h> #include <ripple/protocol/types.h>
namespace ripple { namespace ripple {
AcceptedLedgerTx::AcceptedLedgerTx (Ledger::ref ledger, SerialIter& sit) AcceptedLedgerTx::AcceptedLedgerTx (
: mLedger (ledger) std::shared_ptr<ReadView const> const& ledger,
{ std::shared_ptr<STTx const> const& txn,
// VFALCO This is making a needless copy std::shared_ptr<STObject const> const& met,
auto const vl = sit.getVL(); AccountIDCache const& accountCache,
SerialIter txnIt (makeSlice(vl)); Logs& logs)
mTxn = std::make_shared<STTx> (std::ref (txnIt));
mRawMeta = sit.getVL ();
mMeta = std::make_shared<TxMeta> (mTxn->getTransactionID (),
ledger->info().seq, mRawMeta);
mAffected = mMeta->getAffectedAccounts ();
mResult = mMeta->getResultTER ();
buildJson ();
}
AcceptedLedgerTx::AcceptedLedgerTx (Ledger::ref ledger,
STTx::ref txn, TxMeta::ref met)
: mLedger (ledger) : mLedger (ledger)
, mTxn (txn) , mTxn (txn)
, mMeta (met) , mMeta (std::make_shared<TxMeta> (
, mAffected (met->getAffectedAccounts ()) txn->getTransactionID(), ledger->seq(), *met, logs.journal ("View")))
, mAffected (mMeta->getAffectedAccounts ())
, accountCache_ (accountCache)
, logs_ (logs)
{ {
assert (! ledger->info().open);
mResult = mMeta->getResultTER (); mResult = mMeta->getResultTER ();
Serializer s;
met->add(s);
mRawMeta = std::move (s.modData());
buildJson (); buildJson ();
} }
AcceptedLedgerTx::AcceptedLedgerTx (Ledger::ref ledger, AcceptedLedgerTx::AcceptedLedgerTx (
STTx::ref txn, TER result) std::shared_ptr<ReadView const> const& ledger,
STTx::ref txn,
TER result,
AccountIDCache const& accountCache,
Logs& logs)
: mLedger (ledger) : mLedger (ledger)
, mTxn (txn) , mTxn (txn)
, mResult (result) , mResult (result)
, mAffected (txn->getMentionedAccounts ()) , mAffected (txn->getMentionedAccounts ())
, accountCache_ (accountCache)
, logs_ (logs)
{ {
assert (ledger->info().open);
buildJson (); buildJson ();
} }
@@ -86,7 +92,7 @@ void AcceptedLedgerTx::buildJson ()
{ {
Json::Value& affected = (mJson[jss::affected] = Json::arrayValue); Json::Value& affected = (mJson[jss::affected] = Json::arrayValue);
for (auto const& account: mAffected) for (auto const& account: mAffected)
affected.append (getApp().accountIDCache().toBase58(account)); affected.append (accountCache_.toBase58(account));
} }
if (mTxn->getTxnType () == ttOFFER_CREATE) if (mTxn->getTxnType () == ttOFFER_CREATE)
@@ -98,7 +104,7 @@ void AcceptedLedgerTx::buildJson ()
if (account != amount.issue ().account) if (account != amount.issue ().account)
{ {
auto const ownerFunds = accountFunds(*mLedger, auto const ownerFunds = accountFunds(*mLedger,
account, amount, fhIGNORE_FREEZE, getConfig()); account, amount, fhIGNORE_FREEZE, logs_.journal ("View"));
mJson[jss::transaction][jss::owner_funds] = ownerFunds.getText (); mJson[jss::transaction][jss::owner_funds] = ownerFunds.getText ();
} }
} }

View File

@@ -21,10 +21,13 @@
#define RIPPLE_APP_LEDGER_ACCEPTEDLEDGERTX_H_INCLUDED #define RIPPLE_APP_LEDGER_ACCEPTEDLEDGERTX_H_INCLUDED
#include <ripple/app/ledger/Ledger.h> #include <ripple/app/ledger/Ledger.h>
#include <ripple/protocol/AccountID.h>
#include <boost/container/flat_set.hpp> #include <boost/container/flat_set.hpp>
namespace ripple { namespace ripple {
class Logs;
/** /**
A transaction that is in a closed ledger. A transaction that is in a closed ledger.
@@ -51,16 +54,24 @@ public:
using ref = const pointer&; using ref = const pointer&;
public: public:
AcceptedLedgerTx (Ledger::ref ledger, SerialIter& sit); AcceptedLedgerTx (
AcceptedLedgerTx (Ledger::ref ledger, STTx::ref, std::shared_ptr<ReadView const> const& ledger,
TxMeta::ref); std::shared_ptr<STTx const> const&,
AcceptedLedgerTx (Ledger::ref ledger, STTx::ref, TER result); std::shared_ptr<STObject const> const&,
AccountIDCache const&,
Logs&);
AcceptedLedgerTx (
std::shared_ptr<ReadView const> const&,
STTx::ref,
TER,
AccountIDCache const&,
Logs&);
STTx::ref getTxn () const std::shared_ptr <STTx const> const& getTxn () const
{ {
return mTxn; return mTxn;
} }
TxMeta::ref getMeta () const std::shared_ptr <TxMeta> const& getMeta () const
{ {
return mMeta; return mMeta;
} }
@@ -103,13 +114,15 @@ public:
} }
private: private:
Ledger::pointer mLedger; std::shared_ptr<ReadView const> mLedger;
STTx::pointer mTxn; std::shared_ptr<STTx const> mTxn;
TxMeta::pointer mMeta; std::shared_ptr<TxMeta> mMeta;
TER mResult; TER mResult;
boost::container::flat_set<AccountID> mAffected; boost::container::flat_set<AccountID> mAffected;
Blob mRawMeta; Blob mRawMeta;
Json::Value mJson; Json::Value mJson;
AccountIDCache const& accountCache_;
Logs& logs_;
void buildJson (); void buildJson ();
}; };

View File

@@ -28,6 +28,11 @@
namespace ripple { namespace ripple {
AccountStateSF::AccountStateSF(Application& app)
: app_ (app)
{
}
void AccountStateSF::gotNode (bool fromFilter, void AccountStateSF::gotNode (bool fromFilter,
SHAMapNodeID const& id, SHAMapNodeID const& id,
uint256 const& nodeHash, uint256 const& nodeHash,
@@ -37,7 +42,7 @@ void AccountStateSF::gotNode (bool fromFilter,
// VFALCO SHAMapSync filters should be passed the SHAMap, the // VFALCO SHAMapSync filters should be passed the SHAMap, the
// SHAMap should provide an accessor to get the injected Database, // SHAMap should provide an accessor to get the injected Database,
// and this should use that Database instad of getNodeStore // and this should use that Database instad of getNodeStore
getApp().getNodeStore ().store ( app_.getNodeStore ().store (
hotACCOUNT_NODE, std::move (nodeData), nodeHash); hotACCOUNT_NODE, std::move (nodeData), nodeHash);
} }
@@ -45,7 +50,7 @@ bool AccountStateSF::haveNode (SHAMapNodeID const& id,
uint256 const& nodeHash, uint256 const& nodeHash,
Blob& nodeData) Blob& nodeData)
{ {
return getApp().getLedgerMaster ().getFetchPack (nodeHash, nodeData); return app_.getLedgerMaster ().getFetchPack (nodeHash, nodeData);
} }
} // ripple } // ripple

View File

@@ -20,6 +20,7 @@
#ifndef RIPPLE_APP_LEDGER_ACCOUNTSTATESF_H_INCLUDED #ifndef RIPPLE_APP_LEDGER_ACCOUNTSTATESF_H_INCLUDED
#define RIPPLE_APP_LEDGER_ACCOUNTSTATESF_H_INCLUDED #define RIPPLE_APP_LEDGER_ACCOUNTSTATESF_H_INCLUDED
#include <ripple/app/main/Application.h>
#include <ripple/shamap/SHAMapSyncFilter.h> #include <ripple/shamap/SHAMapSyncFilter.h>
namespace ripple { namespace ripple {
@@ -29,8 +30,12 @@ namespace ripple {
class AccountStateSF class AccountStateSF
: public SHAMapSyncFilter : public SHAMapSyncFilter
{ {
private:
Application& app_;
public: public:
AccountStateSF() = default; explicit
AccountStateSF (Application& app);
// Note that the nodeData is overwritten by this call // Note that the nodeData is overwritten by this call
void gotNode (bool fromFilter, void gotNode (bool fromFilter,

View File

@@ -22,8 +22,11 @@
#include <ripple/app/ledger/LedgerConsensus.h> #include <ripple/app/ledger/LedgerConsensus.h>
#include <ripple/app/ledger/LedgerMaster.h> #include <ripple/app/ledger/LedgerMaster.h>
#include <ripple/app/main/Application.h>
#include <ripple/app/tx/InboundTransactions.h> #include <ripple/app/tx/InboundTransactions.h>
#include <ripple/app/tx/LocalTxs.h> #include <ripple/app/tx/LocalTxs.h>
#include <ripple/basics/Log.h>
#include <ripple/core/Config.h>
#include <beast/cxx14/memory.h> // <memory> #include <beast/cxx14/memory.h> // <memory>
@@ -62,6 +65,7 @@ public:
virtual virtual
std::shared_ptr<LedgerConsensus> std::shared_ptr<LedgerConsensus>
startRound ( startRound (
Application& app,
InboundTransactions& inboundTransactions, InboundTransactions& inboundTransactions,
LocalTxs& localtx, LocalTxs& localtx,
LedgerMaster& ledgerMaster, LedgerMaster& ledgerMaster,
@@ -82,7 +86,7 @@ public:
}; };
std::unique_ptr<Consensus> std::unique_ptr<Consensus>
make_Consensus (); make_Consensus (Config const& config, Logs& logs);
} }

View File

@@ -30,12 +30,15 @@
namespace ripple { namespace ripple {
ConsensusTransSetSF::ConsensusTransSetSF (NodeCache& nodeCache) ConsensusTransSetSF::ConsensusTransSetSF (Application& app, NodeCache& nodeCache)
: m_nodeCache (nodeCache) : app_ (app)
, m_nodeCache (nodeCache)
, j_ (app.journal ("TransactionAcquire"))
{ {
} }
void ConsensusTransSetSF::gotNode (bool fromFilter, const SHAMapNodeID& id, uint256 const& nodeHash, void ConsensusTransSetSF::gotNode (
bool fromFilter, const SHAMapNodeID& id, uint256 const& nodeHash,
Blob& nodeData, SHAMapTreeNode::TNType type) Blob& nodeData, SHAMapTreeNode::TNType type)
{ {
if (fromFilter) if (fromFilter)
@@ -46,7 +49,8 @@ void ConsensusTransSetSF::gotNode (bool fromFilter, const SHAMapNodeID& id, uint
if ((type == SHAMapTreeNode::tnTRANSACTION_NM) && (nodeData.size () > 16)) if ((type == SHAMapTreeNode::tnTRANSACTION_NM) && (nodeData.size () > 16))
{ {
// this is a transaction, and we didn't have it // this is a transaction, and we didn't have it
WriteLog (lsDEBUG, TransactionAcquire) << "Node on our acquiring TX set is TXN we may not have"; JLOG (j_.debug)
<< "Node on our acquiring TX set is TXN we may not have";
try try
{ {
@@ -55,31 +59,34 @@ void ConsensusTransSetSF::gotNode (bool fromFilter, const SHAMapNodeID& id, uint
SerialIter sit (s.slice()); SerialIter sit (s.slice());
STTx::pointer stx = std::make_shared<STTx> (std::ref (sit)); STTx::pointer stx = std::make_shared<STTx> (std::ref (sit));
assert (stx->getTransactionID () == nodeHash); assert (stx->getTransactionID () == nodeHash);
getApp().getJobQueue ().addJob ( auto const pap = &app_;
app_.getJobQueue ().addJob (
jtTRANSACTION, "TXS->TXN", jtTRANSACTION, "TXS->TXN",
std::bind (&NetworkOPs::submitTransaction, &getApp().getOPs (), [pap, stx] (Job&) {
std::placeholders::_1, stx)); pap->getOPs().submitTransaction(stx);
});
} }
catch (...) catch (...)
{ {
WriteLog (lsWARNING, TransactionAcquire) << "Fetched invalid transaction in proposed set"; JLOG (j_.warning)
<< "Fetched invalid transaction in proposed set";
} }
} }
} }
bool ConsensusTransSetSF::haveNode (const SHAMapNodeID& id, uint256 const& nodeHash, bool ConsensusTransSetSF::haveNode (
Blob& nodeData) const SHAMapNodeID& id, uint256 const& nodeHash, Blob& nodeData)
{ {
if (m_nodeCache.retrieve (nodeHash, nodeData)) if (m_nodeCache.retrieve (nodeHash, nodeData))
return true; return true;
// VFALCO TODO Use a dependency injection here auto txn = app_.getMasterTransaction().fetch(nodeHash, false);
Transaction::pointer txn = getApp().getMasterTransaction().fetch(nodeHash, false);
if (txn) if (txn)
{ {
// this is a transaction, and we have it // this is a transaction, and we have it
WriteLog (lsTRACE, TransactionAcquire) << "Node in our acquiring TX set is TXN we have"; JLOG (j_.trace)
<< "Node in our acquiring TX set is TXN we have";
Serializer s; Serializer s;
s.add32 (HashPrefix::transactionID); s.add32 (HashPrefix::transactionID);
txn->getSTransaction ()->add (s); txn->getSTransaction ()->add (s);

View File

@@ -20,6 +20,7 @@
#ifndef RIPPLE_APP_LEDGER_CONSENSUSTRANSSETSF_H_INCLUDED #ifndef RIPPLE_APP_LEDGER_CONSENSUSTRANSSETSF_H_INCLUDED
#define RIPPLE_APP_LEDGER_CONSENSUSTRANSSETSF_H_INCLUDED #define RIPPLE_APP_LEDGER_CONSENSUSTRANSSETSF_H_INCLUDED
#include <ripple/app/main/Application.h>
#include <ripple/shamap/SHAMapSyncFilter.h> #include <ripple/shamap/SHAMapSyncFilter.h>
#include <ripple/basics/TaggedCache.h> #include <ripple/basics/TaggedCache.h>
@@ -35,8 +36,7 @@ class ConsensusTransSetSF : public SHAMapSyncFilter
public: public:
using NodeCache = TaggedCache <uint256, Blob>; using NodeCache = TaggedCache <uint256, Blob>;
// VFALCO TODO Use a dependency injection to get the temp node cache ConsensusTransSetSF (Application& app, NodeCache& nodeCache);
ConsensusTransSetSF (NodeCache& nodeCache);
// Note that the nodeData is overwritten by this call // Note that the nodeData is overwritten by this call
void gotNode (bool fromFilter, void gotNode (bool fromFilter,
@@ -50,7 +50,9 @@ public:
Blob& nodeData) override; Blob& nodeData) override;
private: private:
Application& app_;
NodeCache& m_nodeCache; NodeCache& m_nodeCache;
beast::Journal j_;
}; };
} // ripple } // ripple

View File

@@ -20,6 +20,7 @@
#ifndef RIPPLE_APP_LEDGER_INBOUNDLEDGER_H_INCLUDED #ifndef RIPPLE_APP_LEDGER_INBOUNDLEDGER_H_INCLUDED
#define RIPPLE_APP_LEDGER_INBOUNDLEDGER_H_INCLUDED #define RIPPLE_APP_LEDGER_INBOUNDLEDGER_H_INCLUDED
#include <ripple/app/main/Application.h>
#include <ripple/app/ledger/Ledger.h> #include <ripple/app/ledger/Ledger.h>
#include <ripple/overlay/PeerSet.h> #include <ripple/overlay/PeerSet.h>
#include <ripple/basics/CountedObject.h> #include <ripple/basics/CountedObject.h>
@@ -37,7 +38,8 @@ public:
static char const* getCountedObjectName () { return "InboundLedger"; } static char const* getCountedObjectName () { return "InboundLedger"; }
using pointer = std::shared_ptr <InboundLedger>; using pointer = std::shared_ptr <InboundLedger>;
using PeerDataPairType = std::pair < std::weak_ptr<Peer>, std::shared_ptr<protocol::TMLedgerData> >; using PeerDataPairType = std::pair<std::weak_ptr<Peer>,
std::shared_ptr<protocol::TMLedgerData>>;
// These are the reasons we might acquire a ledger // These are the reasons we might acquire a ledger
enum fcReason enum fcReason
@@ -50,7 +52,8 @@ public:
}; };
public: public:
InboundLedger (uint256 const& hash, std::uint32_t seq, fcReason reason, clock_type& clock); InboundLedger(Application& app,
uint256 const& hash, std::uint32_t seq, fcReason reason, clock_type&);
~InboundLedger (); ~InboundLedger ();
@@ -97,12 +100,14 @@ public:
bool gotData (std::weak_ptr<Peer>, std::shared_ptr<protocol::TMLedgerData>); bool gotData (std::weak_ptr<Peer>, std::shared_ptr<protocol::TMLedgerData>);
using neededHash_t = std::pair <protocol::TMGetObjectByHash::ObjectType, uint256>; using neededHash_t =
std::pair <protocol::TMGetObjectByHash::ObjectType, uint256>;
std::vector<neededHash_t> getNeededHashes (); std::vector<neededHash_t> getNeededHashes ();
// VFALCO TODO Replace uint256 with something semanticallyh meaningful // VFALCO TODO Replace uint256 with something semanticallyh meaningful
void filterNodes (std::vector<SHAMapNodeID>& nodeIDs, std::vector<uint256>& nodeHashes, void filterNodes (
std::vector<SHAMapNodeID>& nodeIDs, std::vector<uint256>& nodeHashes,
int max, bool aggressive); int max, bool aggressive);
/** Return a Json::objectValue. */ /** Return a Json::objectValue. */
@@ -127,7 +132,8 @@ private:
int processData (std::shared_ptr<Peer> peer, protocol::TMLedgerData& data); int processData (std::shared_ptr<Peer> peer, protocol::TMLedgerData& data);
bool takeHeader (std::string const& data); bool takeHeader (std::string const& data);
bool takeTxNode (const std::vector<SHAMapNodeID>& IDs, const std::vector<Blob>& data, bool takeTxNode (const std::vector<SHAMapNodeID>& IDs,
const std::vector<Blob>& data,
SHAMapAddNode&); SHAMapAddNode&);
bool takeTxRootNode (Blob const& data, SHAMapAddNode&); bool takeTxRootNode (Blob const& data, SHAMapAddNode&);
@@ -135,7 +141,8 @@ private:
// Don't use acronyms, but if we are going to use them at least // Don't use acronyms, but if we are going to use them at least
// capitalize them correctly. // capitalize them correctly.
// //
bool takeAsNode (const std::vector<SHAMapNodeID>& IDs, const std::vector<Blob>& data, bool takeAsNode (const std::vector<SHAMapNodeID>& IDs,
const std::vector<Blob>& data,
SHAMapAddNode&); SHAMapAddNode&);
bool takeAsRootNode (Blob const& data, SHAMapAddNode&); bool takeAsRootNode (Blob const& data, SHAMapAddNode&);

View File

@@ -56,7 +56,7 @@ public:
std::shared_ptr<Peer>, std::shared_ptr<Peer>,
std::shared_ptr <protocol::TMLedgerData>) = 0; std::shared_ptr <protocol::TMLedgerData>) = 0;
virtual void doLedgerData (Job&, LedgerHash hash) = 0; virtual void doLedgerData (LedgerHash hash) = 0;
virtual void gotStaleData ( virtual void gotStaleData (
std::shared_ptr <protocol::TMLedgerData> packet) = 0; std::shared_ptr <protocol::TMLedgerData> packet) = 0;
@@ -77,14 +77,15 @@ public:
/** Called when a complete ledger is obtained. */ /** Called when a complete ledger is obtained. */
virtual void onLedgerFetched (InboundLedger::fcReason why) = 0; virtual void onLedgerFetched (InboundLedger::fcReason why) = 0;
virtual void gotFetchPack (Job&) = 0; virtual void gotFetchPack () = 0;
virtual void sweep () = 0; virtual void sweep () = 0;
virtual void onStop() = 0; virtual void onStop() = 0;
}; };
std::unique_ptr<InboundLedgers> std::unique_ptr<InboundLedgers>
make_InboundLedgers (InboundLedgers::clock_type& clock, beast::Stoppable& parent, make_InboundLedgers (Application& app,
InboundLedgers::clock_type& clock, beast::Stoppable& parent,
beast::insight::Collector::ptr const& collector); beast::insight::Collector::ptr const& collector);

File diff suppressed because it is too large Load Diff

View File

@@ -22,8 +22,10 @@
#include <ripple/ledger/TxMeta.h> #include <ripple/ledger/TxMeta.h>
#include <ripple/ledger/View.h> #include <ripple/ledger/View.h>
#include <ripple/ledger/CachedView.h>
#include <ripple/app/tx/Transaction.h> #include <ripple/app/tx/Transaction.h>
#include <ripple/basics/CountedObject.h> #include <ripple/basics/CountedObject.h>
#include <ripple/core/TimeKeeper.h>
#include <ripple/protocol/Indexes.h> #include <ripple/protocol/Indexes.h>
#include <ripple/protocol/STLedgerEntry.h> #include <ripple/protocol/STLedgerEntry.h>
#include <ripple/protocol/Serializer.h> #include <ripple/protocol/Serializer.h>
@@ -35,6 +37,7 @@
namespace ripple { namespace ripple {
class Application;
class Job; class Job;
class TransactionMaster; class TransactionMaster;
@@ -67,8 +70,9 @@ extern create_genesis_t const create_genesis;
3) Mutable ledgers cannot be shared. 3) Mutable ledgers cannot be shared.
@note Presented to clients as ReadView @note Presented to clients as ReadView
@note Calls virtuals in the constructor, so marked as final
*/ */
class Ledger class Ledger final
: public std::enable_shared_from_this <Ledger> : public std::enable_shared_from_this <Ledger>
, public DigestAwareReadView , public DigestAwareReadView
, public TxsRawView , public TxsRawView
@@ -95,14 +99,16 @@ public:
starts in this account can ever exist, with amounts starts in this account can ever exist, with amounts
used to pay fees being destroyed. used to pay fees being destroyed.
*/ */
Ledger (create_genesis_t, Config const& config); Ledger (create_genesis_t, Config const& config, Family& family);
// Used for ledgers loaded from JSON files // Used for ledgers loaded from JSON files
Ledger (uint256 const& parentHash, uint256 const& transHash, Ledger (uint256 const& parentHash, uint256 const& transHash,
uint256 const& accountHash, uint256 const& accountHash,
std::uint64_t totDrops, std::uint32_t closeTime, std::uint64_t totDrops, std::uint32_t closeTime,
std::uint32_t parentCloseTime, int closeFlags, int closeResolution, std::uint32_t parentCloseTime, int closeFlags, int closeResolution,
std::uint32_t ledgerSeq, bool & loaded, Config const& config); std::uint32_t ledgerSeq, bool & loaded, Config const& config,
Family& family,
beast::Journal j);
// Create a new ledger that's a snapshot of this one // Create a new ledger that's a snapshot of this one
Ledger (Ledger const& target, bool isMutable); Ledger (Ledger const& target, bool isMutable);
@@ -113,15 +119,17 @@ public:
follows previous, and have follows previous, and have
parentCloseTime == previous.closeTime. parentCloseTime == previous.closeTime.
*/ */
Ledger (open_ledger_t, Ledger const& previous); Ledger (open_ledger_t, Ledger const& previous,
NetClock::time_point closeTime);
Ledger (void const* data, Ledger (void const* data,
std::size_t size, bool hasPrefix, std::size_t size, bool hasPrefix,
Config const& config); Config const& config, Family& family);
// used for database ledgers // used for database ledgers
Ledger (std::uint32_t ledgerSeq, Ledger (std::uint32_t ledgerSeq,
std::uint32_t closeTime, Config const& config); std::uint32_t closeTime, Config const& config,
Family& family);
~Ledger(); ~Ledger();
@@ -130,7 +138,7 @@ public:
// //
LedgerInfo const& LedgerInfo const&
info() const info() const override
{ {
return info_; return info_;
} }
@@ -141,16 +149,31 @@ public:
return fees_; return fees_;
} }
Rules const&
rules() const override
{
return rules_;
}
bool bool
exists (Keylet const& k) const override; exists (Keylet const& k) const override;
boost::optional<uint256> boost::optional<uint256>
succ (uint256 const& key, boost::optional< succ (uint256 const& key, boost::optional<
uint256> last = boost::none) const override; uint256> const& last = boost::none) const override;
std::shared_ptr<SLE const> std::shared_ptr<SLE const>
read (Keylet const& k) const override; read (Keylet const& k) const override;
std::unique_ptr<sles_type::iter_base>
slesBegin() const override;
std::unique_ptr<sles_type::iter_base>
slesEnd() const override;
std::unique_ptr<sles_type::iter_base>
slesUpperBound(uint256 const& key) const override;
std::unique_ptr<txs_type::iter_base> std::unique_ptr<txs_type::iter_base>
txsBegin() const override; txsBegin() const override;
@@ -187,9 +210,9 @@ public:
SLE> const& sle) override; SLE> const& sle) override;
void void
rawDestroyXRP (std::uint64_t feeDrops) override rawDestroyXRP (XRPAmount const& fee) override
{ {
info_.drops -= feeDrops; info_.drops -= fee;
} }
// //
@@ -215,11 +238,10 @@ public:
} }
void setAccepted (std::uint32_t closeTime, void setAccepted (std::uint32_t closeTime,
int closeResolution, bool correctCloseTime); int closeResolution, bool correctCloseTime,
Config const& config);
void setAccepted (); void setImmutable (Config const& config);
void setImmutable ();
bool isImmutable () const bool isImmutable () const
{ {
@@ -237,7 +259,7 @@ public:
// ledger signature operations // ledger signature operations
void addRaw (Serializer& s) const; void addRaw (Serializer& s) const;
void setRaw (SerialIter& sit, bool hasPrefix); void setRaw (SerialIter& sit, bool hasPrefix, Family& family);
// DEPRECATED // DEPRECATED
// Remove contract.h include // Remove contract.h include
@@ -302,11 +324,6 @@ public:
void visitStateItems (std::function<void (SLE::ref)>) const; void visitStateItems (std::function<void (SLE::ref)>) const;
bool pendSaveValidated (bool isSynchronous, bool isCurrent);
// first node >hash, <last
uint256 getNextLedgerIndex (uint256 const& hash,
boost::optional<uint256> const& last = boost::none) const;
std::vector<uint256> getNeededTransactionHashes ( std::vector<uint256> getNeededTransactionHashes (
int max, SHAMapSyncFilter* filter) const; int max, SHAMapSyncFilter* filter) const;
@@ -314,64 +331,18 @@ public:
std::vector<uint256> getNeededAccountStateHashes ( std::vector<uint256> getNeededAccountStateHashes (
int max, SHAMapSyncFilter* filter) const; int max, SHAMapSyncFilter* filter) const;
std::uint32_t getReferenceFeeUnits() const bool walkLedger (beast::Journal j) const;
{
// Returns the cost of the reference transaction in fee units
deprecatedUpdateCachedFees ();
return mReferenceFeeUnits;
}
std::uint64_t getBaseFee() const bool assertSane (beast::Journal ledgerJ);
{
// Returns the cost of the reference transaction in drops
deprecatedUpdateCachedFees ();
return mBaseFee;
}
// DEPRECATED use fees()
std::uint64_t getReserve (int increments) const
{
// Returns the required reserve in drops
deprecatedUpdateCachedFees ();
return static_cast<std::uint64_t> (increments) * mReserveIncrement
+ mReserveBase;
}
// DEPRECATED use fees()
std::uint64_t getReserveInc () const
{
deprecatedUpdateCachedFees ();
return mReserveIncrement;
}
bool walkLedger () const;
bool assertSane ();
// database functions (low-level)
static Ledger::pointer loadByIndex (std::uint32_t ledgerIndex);
static Ledger::pointer loadByHash (uint256 const& ledgerHash);
static uint256 getHashByIndex (std::uint32_t index);
static bool getHashesByIndex (
std::uint32_t index, uint256 & ledgerHash, uint256 & parentHash);
static std::map< std::uint32_t, std::pair<uint256, uint256> >
getHashesByIndex (std::uint32_t minSeq, std::uint32_t maxSeq);
private: private:
class sles_iter_impl;
class txs_iter_impl; class txs_iter_impl;
void saveValidatedLedgerAsync(Job&, bool current)
{
saveValidatedLedger(current);
}
bool saveValidatedLedger (bool current); bool saveValidatedLedger (bool current);
void bool
setFees (Config const& config); setup (Config const& config);
std::shared_ptr<SLE> std::shared_ptr<SLE>
peek (Keylet const& k) const; peek (Keylet const& k) const;
@@ -379,13 +350,6 @@ private:
void void
updateHash(); updateHash();
// Updates the fees cached in the ledger.
// Safe to call concurrently. We shouldn't be storing
// fees in the Ledger object, they should be a local side-structure
// associated with a particular module (rpc, tx processing, consensus)
//
void deprecatedUpdateCachedFees() const;
// The basic Ledger structure, can be opened, closed, or synching // The basic Ledger structure, can be opened, closed, or synching
bool mValidHash = false; bool mValidHash = false;
@@ -398,26 +362,56 @@ private:
std::mutex mutable mutex_; std::mutex mutable mutex_;
Fees fees_; Fees fees_;
Rules rules_;
LedgerInfo info_; LedgerInfo info_;
// Ripple cost of the reference transaction
std::uint64_t mutable mBaseFee = 0;
// Fee units for the reference transaction
std::uint32_t mutable mReferenceFeeUnits = 0;
// Reserve base in drops
std::uint32_t mutable mReserveBase = 0;
// Reserve increment in drops
std::uint32_t mutable mReserveIncrement = 0;
}; };
/** A ledger wrapped in a CachedView. */
using CachedLedger = CachedView<Ledger>;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// //
// API // API
// //
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
extern
bool
pendSaveValidated(
Application& app,
std::shared_ptr<Ledger> const& ledger,
bool isSynchronous,
bool isCurrent);
extern
Ledger::pointer
loadByIndex (std::uint32_t ledgerIndex,
Application& app);
extern
std::tuple<Ledger::pointer, std::uint32_t, uint256>
loadLedgerHelper(std::string const& sqlSuffix,
Application& app);
extern
Ledger::pointer
loadByHash (uint256 const& ledgerHash, Application& app);
extern
uint256
getHashByIndex(std::uint32_t index, Application& app);
extern
bool
getHashesByIndex(std::uint32_t index,
uint256 &ledgerHash, uint256& parentHash,
Application& app);
extern
std::map< std::uint32_t, std::pair<uint256, uint256>>
getHashesByIndex (std::uint32_t minSeq, std::uint32_t maxSeq,
Application& app);
/** Deserialize a SHAMapItem containing a single STTx /** Deserialize a SHAMapItem containing a single STTx
Throw: Throw:
@@ -441,9 +435,6 @@ std::pair<std::shared_ptr<
STObject const>> STObject const>>
deserializeTxPlusMeta (SHAMapItem const& item); deserializeTxPlusMeta (SHAMapItem const& item);
std::tuple<Ledger::pointer, std::uint32_t, uint256>
loadLedgerHelper(std::string const& sqlSuffix);
// DEPRECATED // DEPRECATED
inline inline
std::shared_ptr<SLE const> std::shared_ptr<SLE const>
@@ -457,23 +448,6 @@ cachedRead (ReadView const& ledger, uint256 const& key,
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// VFALCO NOTE This is called from only one place
Transaction::pointer
getTransaction (Ledger const& ledger,
uint256 const& transID, TransactionMaster& cache);
// VFALCO NOTE This is called from only one place
bool
getTransaction (Ledger const& ledger,
uint256 const& transID, Transaction::pointer & txn,
TxMeta::pointer & txMeta,
TransactionMaster& cache);
bool
getTransactionMeta (Ledger const&,
uint256 const& transID,
TxMeta::pointer & txMeta);
void void
ownerDirDescriber (SLE::ref, bool, AccountID const& owner); ownerDirDescriber (SLE::ref, bool, AccountID const& owner);
@@ -483,7 +457,7 @@ qualityDirDescriber (
SLE::ref, bool, SLE::ref, bool,
Currency const& uTakerPaysCurrency, AccountID const& uTakerPaysIssuer, Currency const& uTakerPaysCurrency, AccountID const& uTakerPaysIssuer,
Currency const& uTakerGetsCurrency, AccountID const& uTakerGetsIssuer, Currency const& uTakerGetsCurrency, AccountID const& uTakerGetsIssuer,
const std::uint64_t & uRate); const std::uint64_t & uRate, Application& app);
} // ripple } // ripple

View File

@@ -22,6 +22,7 @@
#include <ripple/app/ledger/Ledger.h> #include <ripple/app/ledger/Ledger.h>
#include <ripple/app/ledger/LedgerProposal.h> #include <ripple/app/ledger/LedgerProposal.h>
#include <ripple/app/main/Application.h>
#include <ripple/app/misc/CanonicalTXSet.h> #include <ripple/app/misc/CanonicalTXSet.h>
#include <ripple/app/misc/FeeVote.h> #include <ripple/app/misc/FeeVote.h>
#include <ripple/app/tx/InboundTransactions.h> #include <ripple/app/tx/InboundTransactions.h>
@@ -79,12 +80,28 @@ public:
@param openLgr true if applyLedger is open, else false. @param openLgr true if applyLedger is open, else false.
*/ */
void applyTransactions ( void applyTransactions (
Application& app,
SHAMap const* set, SHAMap const* set,
OpenView& view, OpenView& view,
Ledger::ref checkLedger, Ledger::ref checkLedger,
CanonicalTXSet& retriableTransactions, CanonicalTXSet& retriableTransactions,
ApplyFlags flags); ApplyFlags flags);
/** Apply a single transaction to a ledger
@param view The open view to apply to
@param txn The transaction to apply
@param retryAssured True if another pass is assured
@param flags Flags for transactor
@return resultSuccess, resultFail or resultRetry
*/
int applyTransaction (
Application& app,
OpenView& view,
std::shared_ptr<STTx const> const& txn,
bool retryAssured,
ApplyFlags flags,
beast::Journal j);
} // ripple } // ripple
#endif #endif

View File

@@ -39,13 +39,16 @@ namespace ripple {
// FIXME: Need to clean up ledgers by index at some point // FIXME: Need to clean up ledgers by index at some point
LedgerHistory::LedgerHistory ( LedgerHistory::LedgerHistory (
beast::insight::Collector::ptr const& collector) beast::insight::Collector::ptr const& collector,
: collector_ (collector) Application& app)
: app_ (app)
, collector_ (collector)
, mismatch_counter_ (collector->make_counter ("ledger.history", "mismatch")) , mismatch_counter_ (collector->make_counter ("ledger.history", "mismatch"))
, m_ledgers_by_hash ("LedgerCache", CACHED_LEDGER_NUM, CACHED_LEDGER_AGE, , m_ledgers_by_hash ("LedgerCache", CACHED_LEDGER_NUM, CACHED_LEDGER_AGE,
stopwatch(), deprecatedLogs().journal("TaggedCache")) stopwatch(), app_.journal("TaggedCache"))
, m_consensus_validated ("ConsensusValidated", 64, 300, , m_consensus_validated ("ConsensusValidated", 64, 300,
stopwatch(), deprecatedLogs().journal("TaggedCache")) stopwatch(), app_.journal("TaggedCache"))
, j_ (app.journal ("LedgerHistory"))
{ {
} }
@@ -56,7 +59,8 @@ bool LedgerHistory::addLedger (Ledger::pointer ledger, bool validated)
LedgersByHash::ScopedLockType sl (m_ledgers_by_hash.peekMutex ()); LedgersByHash::ScopedLockType sl (m_ledgers_by_hash.peekMutex ());
const bool alreadyHad = m_ledgers_by_hash.canonicalize (ledger->getHash(), ledger, true); const bool alreadyHad = m_ledgers_by_hash.canonicalize (
ledger->getHash(), ledger, true);
if (validated) if (validated)
mLedgersByIndex[ledger->info().seq] = ledger->getHash(); mLedgersByIndex[ledger->info().seq] = ledger->getHash();
@@ -66,7 +70,7 @@ bool LedgerHistory::addLedger (Ledger::pointer ledger, bool validated)
LedgerHash LedgerHistory::getLedgerHash (LedgerIndex index) LedgerHash LedgerHistory::getLedgerHash (LedgerIndex index)
{ {
LedgersByHash::ScopedLockType sl (m_ledgers_by_hash.peekMutex ()); LedgersByHash::ScopedLockType sl (m_ledgers_by_hash.peekMutex ());
std::map<std::uint32_t, uint256>::iterator it (mLedgersByIndex.find (index)); auto it = mLedgersByIndex.find (index);
if (it != mLedgersByIndex.end ()) if (it != mLedgersByIndex.end ())
return it->second; return it->second;
@@ -78,7 +82,7 @@ Ledger::pointer LedgerHistory::getLedgerBySeq (LedgerIndex index)
{ {
{ {
LedgersByHash::ScopedLockType sl (m_ledgers_by_hash.peekMutex ()); LedgersByHash::ScopedLockType sl (m_ledgers_by_hash.peekMutex ());
std::map <std::uint32_t, uint256>::iterator it (mLedgersByIndex.find (index)); auto it = mLedgersByIndex.find (index);
if (it != mLedgersByIndex.end ()) if (it != mLedgersByIndex.end ())
{ {
@@ -88,7 +92,7 @@ Ledger::pointer LedgerHistory::getLedgerBySeq (LedgerIndex index)
} }
} }
Ledger::pointer ret (Ledger::loadByIndex (index)); Ledger::pointer ret = loadByIndex (index, app_);
if (!ret) if (!ret)
return ret; return ret;
@@ -117,7 +121,7 @@ Ledger::pointer LedgerHistory::getLedgerByHash (LedgerHash const& hash)
return ret; return ret;
} }
ret = Ledger::loadByHash (hash); ret = loadByHash (hash, app_);
if (!ret) if (!ret)
return ret; return ret;
@@ -132,33 +136,41 @@ Ledger::pointer LedgerHistory::getLedgerByHash (LedgerHash const& hash)
static static
void void
log_one(Ledger::pointer ledger, uint256 const& tx, char const* msg) log_one(Ledger::pointer ledger, uint256 const& tx, char const* msg,
beast::Journal& j)
{ {
TxMeta::pointer metaData; auto metaData = ledger->txRead(tx).second;
getTransactionMeta(*ledger, tx, metaData);
if (metaData != nullptr) if (metaData != nullptr)
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx << JLOG (j.debug) << "MISMATCH on TX " << tx <<
": " << msg << " is missing this transaction:\n" << ": " << msg << " is missing this transaction:\n" <<
metaData->getJson (0); metaData->getJson (0);
} }
else else
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx << JLOG (j.debug) << "MISMATCH on TX " << tx <<
": " << msg << " is missing this transaction."; ": " << msg << " is missing this transaction.";
} }
} }
static static
void void
log_metadata_difference(Ledger::pointer builtLedger, Ledger::pointer validLedger, log_metadata_difference(
uint256 const& tx) Ledger::pointer builtLedger, Ledger::pointer validLedger, uint256 const& tx,
beast::Journal j)
{ {
TxMeta::pointer validMetaData; auto getMeta = [j](Ledger const& ledger,
getTransactionMeta(*validLedger, tx, validMetaData); uint256 const& txID) -> std::shared_ptr<TxMeta>
TxMeta::pointer builtMetaData; {
getTransactionMeta(*builtLedger, tx, builtMetaData); auto meta = ledger.txRead(txID).second;
if (!meta)
return {};
return std::make_shared<TxMeta> (txID, ledger.seq(), *meta, j);
};
auto validMetaData = getMeta (*validLedger, tx);
auto builtMetaData = getMeta (*builtLedger, tx);
assert(validMetaData != nullptr || builtMetaData != nullptr); assert(validMetaData != nullptr || builtMetaData != nullptr);
if (validMetaData != nullptr && builtMetaData != nullptr) if (validMetaData != nullptr && builtMetaData != nullptr)
@@ -176,7 +188,7 @@ log_metadata_difference(Ledger::pointer builtLedger, Ledger::pointer validLedger
if (!result_diff && !index_diff && !nodes_diff) if (!result_diff && !index_diff && !nodes_diff)
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx << JLOG (j.error) << "MISMATCH on TX " << tx <<
": No apparent mismatches detected!"; ": No apparent mismatches detected!";
return; return;
} }
@@ -185,31 +197,31 @@ log_metadata_difference(Ledger::pointer builtLedger, Ledger::pointer validLedger
{ {
if (result_diff && index_diff) if (result_diff && index_diff)
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx << JLOG (j.debug) << "MISMATCH on TX " << tx <<
": Different result and index!"; ": Different result and index!";
WriteLog (lsERROR, LedgerMaster) << " Built:" << JLOG (j.debug) << " Built:" <<
" Result: " << builtMetaData->getResult () << " Result: " << builtMetaData->getResult () <<
" Index: " << builtMetaData->getIndex (); " Index: " << builtMetaData->getIndex ();
WriteLog (lsERROR, LedgerMaster) << " Valid:" << JLOG (j.debug) << " Valid:" <<
" Result: " << validMetaData->getResult () << " Result: " << validMetaData->getResult () <<
" Index: " << validMetaData->getIndex (); " Index: " << validMetaData->getIndex ();
} }
else if (result_diff) else if (result_diff)
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx << JLOG (j.debug) << "MISMATCH on TX " << tx <<
": Different result!"; ": Different result!";
WriteLog (lsERROR, LedgerMaster) << " Built:" << JLOG (j.debug) << " Built:" <<
" Result: " << builtMetaData->getResult (); " Result: " << builtMetaData->getResult ();
WriteLog (lsERROR, LedgerMaster) << " Valid:" << JLOG (j.debug) << " Valid:" <<
" Result: " << validMetaData->getResult (); " Result: " << validMetaData->getResult ();
} }
else if (index_diff) else if (index_diff)
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx << JLOG (j.debug) << "MISMATCH on TX " << tx <<
": Different index!"; ": Different index!";
WriteLog (lsERROR, LedgerMaster) << " Built:" << JLOG (j.debug) << " Built:" <<
" Index: " << builtMetaData->getIndex (); " Index: " << builtMetaData->getIndex ();
WriteLog (lsERROR, LedgerMaster) << " Valid:" << JLOG (j.debug) << " Valid:" <<
" Index: " << validMetaData->getIndex (); " Index: " << validMetaData->getIndex ();
} }
} }
@@ -217,55 +229,55 @@ log_metadata_difference(Ledger::pointer builtLedger, Ledger::pointer validLedger
{ {
if (result_diff && index_diff) if (result_diff && index_diff)
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx << JLOG (j.debug) << "MISMATCH on TX " << tx <<
": Different result, index and nodes!"; ": Different result, index and nodes!";
WriteLog (lsERROR, LedgerMaster) << " Built:\n" << JLOG (j.debug) << " Built:\n" <<
builtMetaData->getJson (0); builtMetaData->getJson (0);
WriteLog (lsERROR, LedgerMaster) << " Valid:\n" << JLOG (j.debug) << " Valid:\n" <<
validMetaData->getJson (0); validMetaData->getJson (0);
} }
else if (result_diff) else if (result_diff)
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx << JLOG (j.debug) << "MISMATCH on TX " << tx <<
": Different result and nodes!"; ": Different result and nodes!";
WriteLog (lsERROR, LedgerMaster) << " Built:" << JLOG (j.debug) << " Built:" <<
" Result: " << builtMetaData->getResult () << " Result: " << builtMetaData->getResult () <<
" Nodes:\n" << builtNodes.getJson (0); " Nodes:\n" << builtNodes.getJson (0);
WriteLog (lsERROR, LedgerMaster) << " Valid:" << JLOG (j.debug) << " Valid:" <<
" Result: " << validMetaData->getResult () << " Result: " << validMetaData->getResult () <<
" Nodes:\n" << validNodes.getJson (0); " Nodes:\n" << validNodes.getJson (0);
} }
else if (index_diff) else if (index_diff)
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx << JLOG (j.debug) << "MISMATCH on TX " << tx <<
": Different index and nodes!"; ": Different index and nodes!";
WriteLog (lsERROR, LedgerMaster) << " Built:" << JLOG (j.debug) << " Built:" <<
" Index: " << builtMetaData->getIndex () << " Index: " << builtMetaData->getIndex () <<
" Nodes:\n" << builtNodes.getJson (0); " Nodes:\n" << builtNodes.getJson (0);
WriteLog (lsERROR, LedgerMaster) << " Valid:" << JLOG (j.debug) << " Valid:" <<
" Index: " << validMetaData->getIndex () << " Index: " << validMetaData->getIndex () <<
" Nodes:\n" << validNodes.getJson (0); " Nodes:\n" << validNodes.getJson (0);
} }
else // nodes_diff else // nodes_diff
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx << JLOG (j.debug) << "MISMATCH on TX " << tx <<
": Different nodes!"; ": Different nodes!";
WriteLog (lsERROR, LedgerMaster) << " Built:" << JLOG (j.debug) << " Built:" <<
" Nodes:\n" << builtNodes.getJson (0); " Nodes:\n" << builtNodes.getJson (0);
WriteLog (lsERROR, LedgerMaster) << " Valid:" << JLOG (j.debug) << " Valid:" <<
" Nodes:\n" << validNodes.getJson (0); " Nodes:\n" << validNodes.getJson (0);
} }
} }
} }
else if (validMetaData != nullptr) else if (validMetaData != nullptr)
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx << JLOG (j.error) << "MISMATCH on TX " << tx <<
": Metadata Difference (built has none)\n" << ": Metadata Difference (built has none)\n" <<
validMetaData->getJson (0); validMetaData->getJson (0);
} }
else // builtMetaData != nullptr else // builtMetaData != nullptr
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on TX " << tx << JLOG (j.error) << "MISMATCH on TX " << tx <<
": Metadata Difference (valid has none)\n" << ": Metadata Difference (valid has none)\n" <<
builtMetaData->getJson (0); builtMetaData->getJson (0);
} }
@@ -288,7 +300,8 @@ leaves (SHAMap const& sm)
} }
void LedgerHistory::handleMismatch (LedgerHash const& built, LedgerHash const& valid) void LedgerHistory::handleMismatch (
LedgerHash const& built, LedgerHash const& valid)
{ {
assert (built != valid); assert (built != valid);
++mismatch_counter_; ++mismatch_counter_;
@@ -298,7 +311,7 @@ void LedgerHistory::handleMismatch (LedgerHash const& built, LedgerHash const& v
if (!builtLedger || !validLedger) if (!builtLedger || !validLedger)
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH cannot be analyzed:" << JLOG (j_.error) << "MISMATCH cannot be analyzed:" <<
" builtLedger: " << to_string (built) << " -> " << builtLedger << " builtLedger: " << to_string (built) << " -> " << builtLedger <<
" validLedger: " << to_string (valid) << " -> " << validLedger; " validLedger: " << to_string (valid) << " -> " << validLedger;
return; return;
@@ -312,14 +325,14 @@ void LedgerHistory::handleMismatch (LedgerHash const& built, LedgerHash const& v
if (builtLedger->info().parentHash != validLedger->info().parentHash) if (builtLedger->info().parentHash != validLedger->info().parentHash)
{ {
// Disagreement over prior ledger indicates sync issue // Disagreement over prior ledger indicates sync issue
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on prior ledger"; JLOG (j_.error) << "MISMATCH on prior ledger";
return; return;
} }
if (builtLedger->info().closeTime != validLedger->info().closeTime) if (builtLedger->info().closeTime != validLedger->info().closeTime)
{ {
// Disagreement over close time indicates Byzantine failure // Disagreement over close time indicates Byzantine failure
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on close time"; JLOG (j_.error) << "MISMATCH on close time";
return; return;
} }
@@ -327,16 +340,16 @@ void LedgerHistory::handleMismatch (LedgerHash const& built, LedgerHash const& v
auto const builtTx = leaves(builtLedger->txMap()); auto const builtTx = leaves(builtLedger->txMap());
auto const validTx = leaves(validLedger->txMap()); auto const validTx = leaves(validLedger->txMap());
if (builtTx == validTx) if (builtTx == validTx)
WriteLog (lsERROR, LedgerMaster) << JLOG (j_.error) <<
"MISMATCH with same " << builtTx.size() << " transactions"; "MISMATCH with same " << builtTx.size() << " transactions";
else else
WriteLog (lsERROR, LedgerMaster) << "MISMATCH with " << JLOG (j_.error) << "MISMATCH with " <<
builtTx.size() << " built and " << builtTx.size() << " built and " <<
validTx.size() << " valid transactions."; validTx.size() << " valid transactions.";
WriteLog(lsERROR, LedgerMaster) << "built\n" << JLOG (j_.error) << "built\n" <<
getJson(*builtLedger); getJson(*builtLedger);
WriteLog(lsERROR, LedgerMaster) << "valid\n" << JLOG (j_.error) << "valid\n" <<
getJson(*validLedger); getJson(*validLedger);
// Log all differences between built and valid ledgers // Log all differences between built and valid ledgers
@@ -346,12 +359,12 @@ void LedgerHistory::handleMismatch (LedgerHash const& built, LedgerHash const& v
{ {
if ((*b)->key() < (*v)->key()) if ((*b)->key() < (*v)->key())
{ {
log_one (builtLedger, (*b)->key(), "valid"); log_one (builtLedger, (*b)->key(), "valid", j_);
++b; ++b;
} }
else if ((*b)->key() > (*v)->key()) else if ((*b)->key() > (*v)->key())
{ {
log_one(validLedger, (*v)->key(), "built"); log_one(validLedger, (*v)->key(), "built", j_);
++v; ++v;
} }
else else
@@ -359,16 +372,16 @@ void LedgerHistory::handleMismatch (LedgerHash const& built, LedgerHash const& v
if ((*b)->peekData() != (*v)->peekData()) if ((*b)->peekData() != (*v)->peekData())
{ {
// Same transaction with different metadata // Same transaction with different metadata
log_metadata_difference(builtLedger, validLedger, (*b)->key()); log_metadata_difference(builtLedger, validLedger, (*b)->key(), j_);
} }
++b; ++b;
++v; ++v;
} }
} }
for (; b != builtTx.end(); ++b) for (; b != builtTx.end(); ++b)
log_one (builtLedger, (*b)->key(), "valid"); log_one (builtLedger, (*b)->key(), "valid", j_);
for (; v != validTx.end(); ++v) for (; v != validTx.end(); ++v)
log_one (validLedger, (*v)->key(), "built"); log_one (validLedger, (*v)->key(), "built", j_);
} }
void LedgerHistory::builtLedger (Ledger::ref ledger) void LedgerHistory::builtLedger (Ledger::ref ledger)
@@ -386,7 +399,7 @@ void LedgerHistory::builtLedger (Ledger::ref ledger)
{ {
if (entry->second.isNonZero() && (entry->second != hash)) if (entry->second.isNonZero() && (entry->second != hash))
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH: seq=" << index JLOG (j_.error) << "MISMATCH: seq=" << index
<< " validated:" << entry->second << " validated:" << entry->second
<< " then:" << hash; << " then:" << hash;
handleMismatch (hash, entry->first); handleMismatch (hash, entry->first);
@@ -403,14 +416,14 @@ void LedgerHistory::validatedLedger (Ledger::ref ledger)
ConsensusValidated::ScopedLockType sl ( ConsensusValidated::ScopedLockType sl (
m_consensus_validated.peekMutex()); m_consensus_validated.peekMutex());
std::shared_ptr< std::pair< LedgerHash, LedgerHash > > entry = std::make_shared<std::pair< LedgerHash, LedgerHash >>(); auto entry = std::make_shared<std::pair<LedgerHash, LedgerHash>>();
m_consensus_validated.canonicalize(index, entry, false); m_consensus_validated.canonicalize(index, entry, false);
if (entry->second != hash) if (entry->second != hash)
{ {
if (entry->first.isNonZero() && (entry->first != hash)) if (entry->first.isNonZero() && (entry->first != hash))
{ {
WriteLog (lsERROR, LedgerMaster) << "MISMATCH: seq=" << index JLOG (j_.error) << "MISMATCH: seq=" << index
<< " built:" << entry->first << " built:" << entry->first
<< " then:" << hash; << " then:" << hash;
handleMismatch (entry->first, hash); handleMismatch (entry->first, hash);
@@ -422,10 +435,11 @@ void LedgerHistory::validatedLedger (Ledger::ref ledger)
/** Ensure m_ledgers_by_hash doesn't have the wrong hash for a particular index /** Ensure m_ledgers_by_hash doesn't have the wrong hash for a particular index
*/ */
bool LedgerHistory::fixIndex (LedgerIndex ledgerIndex, LedgerHash const& ledgerHash) bool LedgerHistory::fixIndex (
LedgerIndex ledgerIndex, LedgerHash const& ledgerHash)
{ {
LedgersByHash::ScopedLockType sl (m_ledgers_by_hash.peekMutex ()); LedgersByHash::ScopedLockType sl (m_ledgers_by_hash.peekMutex ());
std::map<std::uint32_t, uint256>::iterator it (mLedgersByIndex.find (ledgerIndex)); auto it = mLedgersByIndex.find (ledgerIndex);
if ((it != mLedgersByIndex.end ()) && (it->second != ledgerHash) ) if ((it != mLedgersByIndex.end ()) && (it->second != ledgerHash) )
{ {

View File

@@ -21,6 +21,7 @@
#define RIPPLE_APP_LEDGER_LEDGERHISTORY_H_INCLUDED #define RIPPLE_APP_LEDGER_LEDGERHISTORY_H_INCLUDED
#include <ripple/app/ledger/Ledger.h> #include <ripple/app/ledger/Ledger.h>
#include <ripple/app/main/Application.h>
#include <ripple/protocol/RippleLedgerHash.h> #include <ripple/protocol/RippleLedgerHash.h>
#include <beast/insight/Collector.h> #include <beast/insight/Collector.h>
#include <beast/insight/Event.h> #include <beast/insight/Event.h>
@@ -33,8 +34,8 @@ namespace ripple {
class LedgerHistory class LedgerHistory
{ {
public: public:
explicit LedgerHistory (beast::insight::Collector::ptr const& collector,
LedgerHistory (beast::insight::Collector::ptr const& collector); Application& app);
/** Track a ledger /** Track a ledger
@return `true` if the ledger was already tracked @return `true` if the ledger was already tracked
@@ -106,6 +107,7 @@ private:
*/ */
void handleMismatch (LedgerHash const& built, LedgerHash const& valid); void handleMismatch (LedgerHash const& built, LedgerHash const& valid);
Application& app_;
beast::insight::Collector::ptr collector_; beast::insight::Collector::ptr collector_;
beast::insight::Counter mismatch_counter_; beast::insight::Counter mismatch_counter_;
@@ -124,6 +126,8 @@ private:
// Maps ledger indexes to the corresponding hash. // Maps ledger indexes to the corresponding hash.
std::map <LedgerIndex, LedgerHash> mLedgersByIndex; // validated ledgers std::map <LedgerIndex, LedgerHash> mLedgersByIndex; // validated ledgers
beast::Journal j_;
}; };
} // ripple } // ripple

View File

@@ -20,13 +20,13 @@
#ifndef RIPPLE_APP_LEDGER_LEDGERMASTER_H_INCLUDED #ifndef RIPPLE_APP_LEDGER_LEDGERMASTER_H_INCLUDED
#define RIPPLE_APP_LEDGER_LEDGERMASTER_H_INCLUDED #define RIPPLE_APP_LEDGER_LEDGERMASTER_H_INCLUDED
#include <ripple/app/main/Application.h>
#include <ripple/app/ledger/Ledger.h> #include <ripple/app/ledger/Ledger.h>
#include <ripple/app/ledger/LedgerHolder.h> #include <ripple/app/ledger/LedgerHolder.h>
#include <ripple/basics/chrono.h> #include <ripple/basics/chrono.h>
#include <ripple/basics/StringUtilities.h> #include <ripple/basics/StringUtilities.h>
#include <ripple/protocol/RippleLedgerHash.h> #include <ripple/protocol/RippleLedgerHash.h>
#include <ripple/protocol/STValidation.h> #include <ripple/protocol/STValidation.h>
#include <ripple/core/Config.h>
#include <beast/insight/Collector.h> #include <beast/insight/Collector.h>
#include <beast/threads/Stoppable.h> #include <beast/threads/Stoppable.h>
#include <beast/threads/UnlockGuard.h> #include <beast/threads/UnlockGuard.h>
@@ -38,6 +38,14 @@ namespace ripple {
class Peer; class Peer;
struct LedgerReplay
{
std::map< int, std::shared_ptr<STTx const> > txns_;
std::uint32_t closeTime_;
int closeFlags_;
Ledger::pointer prevLedger_;
};
// Tracks the current ledger and any ledgers in the process of closing // Tracks the current ledger and any ledgers in the process of closing
// Tracks ledger history // Tracks ledger history
// Tracks held transactions // Tracks held transactions
@@ -64,13 +72,13 @@ public:
virtual LedgerIndex getCurrentLedgerIndex () = 0; virtual LedgerIndex getCurrentLedgerIndex () = 0;
virtual LedgerIndex getValidLedgerIndex () = 0; virtual LedgerIndex getValidLedgerIndex () = 0;
virtual bool isCompatible (Ledger::pointer,
beast::Journal::Stream, const char* reason) = 0;
virtual LockType& peekMutex () = 0; virtual LockType& peekMutex () = 0;
// The current ledger is the ledger we believe new transactions should go in // The current ledger is the ledger we believe new transactions should go in
virtual Ledger::pointer getCurrentLedger () = 0; virtual std::shared_ptr<ReadView const> getCurrentLedger () = 0;
// The holder for the current ledger
virtual LedgerHolder& getCurrentLedgerHolder() = 0;
// The finalized ledger is the last closed/accepted ledger // The finalized ledger is the last closed/accepted ledger
virtual Ledger::pointer getClosedLedger () = 0; virtual Ledger::pointer getClosedLedger () = 0;
@@ -78,7 +86,11 @@ public:
// The validated ledger is the last fully validated ledger // The validated ledger is the last fully validated ledger
virtual Ledger::pointer getValidatedLedger () = 0; virtual Ledger::pointer getValidatedLedger () = 0;
// This is the last ledger we published to clients and can lag the validated ledger // The Rules are in the last fully validated ledger if there is one.
virtual Rules getValidatedRules() = 0;
// This is the last ledger we published to clients and can lag the validated
// ledger
virtual Ledger::ref getPublishedLedger () = 0; virtual Ledger::ref getPublishedLedger () = 0;
virtual bool isValidLedger(LedgerInfo const&) = 0; virtual bool isValidLedger(LedgerInfo const&) = 0;
@@ -89,18 +101,17 @@ public:
virtual int getMinValidations () = 0; virtual int getMinValidations () = 0;
virtual void setMinValidations (int v) = 0; virtual void setMinValidations (int v, bool strict) = 0;
virtual std::uint32_t getEarliestFetch () = 0; virtual std::uint32_t getEarliestFetch () = 0;
virtual void pushLedger (Ledger::pointer newLedger) = 0;
virtual void pushLedger (Ledger::pointer newLCL, Ledger::pointer newOL) = 0;
virtual bool storeLedger (Ledger::pointer) = 0; virtual bool storeLedger (Ledger::pointer) = 0;
virtual void forceValid (Ledger::pointer) = 0; virtual void forceValid (Ledger::pointer) = 0;
virtual void setFullLedger (Ledger::pointer ledger, bool isSynchronous, bool isCurrent) = 0; virtual void setFullLedger (
Ledger::pointer ledger, bool isSynchronous, bool isCurrent) = 0;
virtual void switchLedgers (Ledger::pointer lastClosed, Ledger::pointer newCurrent) = 0; virtual void switchLCL (Ledger::pointer lastClosed) = 0;
virtual void failedSave(std::uint32_t seq, uint256 const& hash) = 0; virtual void failedSave(std::uint32_t seq, uint256 const& hash) = 0;
@@ -115,23 +126,28 @@ public:
/** Walk to a ledger's hash using the skip list /** Walk to a ledger's hash using the skip list
*/ */
virtual uint256 walkHashBySeq (std::uint32_t index) = 0; virtual uint256 walkHashBySeq (std::uint32_t index) = 0;
virtual uint256 walkHashBySeq (std::uint32_t index, Ledger::ref referenceLedger) = 0; virtual uint256 walkHashBySeq (
std::uint32_t index, Ledger::ref referenceLedger) = 0;
virtual Ledger::pointer getLedgerBySeq (std::uint32_t index) = 0; virtual Ledger::pointer getLedgerBySeq (std::uint32_t index) = 0;
virtual Ledger::pointer getLedgerByHash (uint256 const& hash) = 0; virtual Ledger::pointer getLedgerByHash (uint256 const& hash) = 0;
virtual void setLedgerRangePresent (std::uint32_t minV, std::uint32_t maxV) = 0; virtual void setLedgerRangePresent (
std::uint32_t minV, std::uint32_t maxV) = 0;
virtual uint256 getLedgerHash(std::uint32_t desiredSeq, Ledger::ref knownGoodLedger) = 0; virtual uint256 getLedgerHash(
std::uint32_t desiredSeq, Ledger::ref knownGoodLedger) = 0;
virtual void addHeldTransaction (Transaction::ref trans) = 0; virtual void addHeldTransaction (Transaction::ref trans) = 0;
virtual void fixMismatch (Ledger::ref ledger) = 0; virtual void fixMismatch (Ledger::ref ledger) = 0;
virtual bool haveLedger (std::uint32_t seq) = 0; virtual bool haveLedger (std::uint32_t seq) = 0;
virtual void clearLedger (std::uint32_t seq) = 0; virtual void clearLedger (std::uint32_t seq) = 0;
virtual bool getValidatedRange (std::uint32_t& minVal, std::uint32_t& maxVal) = 0; virtual bool getValidatedRange (
virtual bool getFullValidatedRange (std::uint32_t& minVal, std::uint32_t& maxVal) = 0; std::uint32_t& minVal, std::uint32_t& maxVal) = 0;
virtual bool getFullValidatedRange (
std::uint32_t& minVal, std::uint32_t& maxVal) = 0;
virtual void tune (int size, int age) = 0; virtual void tune (int size, int age) = 0;
virtual void sweep () = 0; virtual void sweep () = 0;
@@ -149,7 +165,8 @@ public:
virtual bool isNewPathRequest () = 0; virtual bool isNewPathRequest () = 0;
virtual void newOrderBookDB () = 0; virtual void newOrderBookDB () = 0;
virtual bool fixIndex (LedgerIndex ledgerIndex, LedgerHash const& ledgerHash) = 0; virtual bool fixIndex (
LedgerIndex ledgerIndex, LedgerHash const& ledgerHash) = 0;
virtual void doLedgerCleaner(Json::Value const& parameters) = 0; virtual void doLedgerCleaner(Json::Value const& parameters) = 0;
virtual beast::PropertyStream::Source& getPropertySource () = 0; virtual beast::PropertyStream::Source& getPropertySource () = 0;
@@ -158,6 +175,10 @@ public:
virtual void clearLedgerCachePrior (LedgerIndex seq) = 0; virtual void clearLedgerCachePrior (LedgerIndex seq) = 0;
// ledger replay
virtual void takeReplay (std::unique_ptr<LedgerReplay> replay) = 0;
virtual std::unique_ptr<LedgerReplay> releaseReplay () = 0;
// Fetch Packs // Fetch Packs
virtual virtual
void gotFetchPack ( void gotFetchPack (
@@ -176,7 +197,7 @@ public:
virtual virtual
void makeFetchPack ( void makeFetchPack (
Job&, std::weak_ptr<Peer> const& wPeer, std::weak_ptr<Peer> const& wPeer,
std::shared_ptr<protocol::TMGetObjectByHash> const& request, std::shared_ptr<protocol::TMGetObjectByHash> const& request,
uint256 haveLedgerHash, uint256 haveLedgerHash,
std::uint32_t uUptime) = 0; std::uint32_t uUptime) = 0;
@@ -187,7 +208,7 @@ public:
std::unique_ptr <LedgerMaster> std::unique_ptr <LedgerMaster>
make_LedgerMaster ( make_LedgerMaster (
Config const& config, Application& app,
Stopwatch& stopwatch, Stopwatch& stopwatch,
beast::Stoppable& parent, beast::Stoppable& parent,
beast::insight::Collector::ptr const& collector, beast::insight::Collector::ptr const& collector,

View File

@@ -115,7 +115,8 @@ public:
return mTime <= cutoff; return mTime <= cutoff;
} }
bool changePosition (uint256 const& newPosition, std::uint32_t newCloseTime); bool changePosition (
uint256 const& newPosition, std::uint32_t newCloseTime);
void bowOut (); void bowOut ();
Json::Value getJson () const; Json::Value getJson () const;

View File

@@ -24,7 +24,7 @@
#include <ripple/ledger/CachedSLEs.h> #include <ripple/ledger/CachedSLEs.h>
#include <ripple/ledger/OpenView.h> #include <ripple/ledger/OpenView.h>
#include <ripple/app/misc/CanonicalTXSet.h> #include <ripple/app/misc/CanonicalTXSet.h>
#include <ripple/app/misc/IHashRouter.h> #include <ripple/app/misc/HashRouter.h>
#include <ripple/basics/Log.h> #include <ripple/basics/Log.h>
#include <ripple/basics/UnorderedContainers.h> #include <ripple/basics/UnorderedContainers.h>
#include <ripple/core/Config.h> #include <ripple/core/Config.h>
@@ -68,11 +68,27 @@ public:
@param ledger A closed ledger @param ledger A closed ledger
*/ */
explicit explicit
OpenLedger (std::shared_ptr< OpenLedger(std::shared_ptr<
Ledger const> const& ledger, Ledger const> const& ledger,
Config const& config, CachedSLEs& cache, Config const& config, CachedSLEs& cache,
beast::Journal journal); beast::Journal journal);
/** Returns `true` if there are no transactions.
The behavior of ledger closing can be different
depending on whether or not transactions exist
in the open ledger.
@note The value returned is only meaningful for
that specific instant in time. An open,
empty ledger can become non empty from
subsequent modifications. Caller is
responsible for synchronizing the meaning of
the return value.
*/
bool
empty() const;
/** Returns a view to the current open ledger. /** Returns a view to the current open ledger.
Thread safety: Thread safety:
@@ -127,13 +143,15 @@ public:
The current view is atomically set to the The current view is atomically set to the
new open view. new open view.
@param rules The rules for the open ledger
@param ledger A new closed ledger @param ledger A new closed ledger
*/ */
void void
accept(std::shared_ptr<Ledger const> const& ledger, accept (Application& app, Rules const& rules,
std::shared_ptr<Ledger const> const& ledger,
OrderedTxs const& locals, bool retriesFirst, OrderedTxs const& locals, bool retriesFirst,
OrderedTxs& retries, ApplyFlags flags, OrderedTxs& retries, ApplyFlags flags,
IHashRouter& router, HashRouter& router,
std::string const& suffix = ""); std::string const& suffix = "");
/** Algorithm for applying transactions. /** Algorithm for applying transactions.
@@ -144,10 +162,11 @@ public:
template <class FwdRange> template <class FwdRange>
static static
void void
apply (OpenView& view, ReadView const& check, apply (Application& app, OpenView& view,
FwdRange const& txs, OrderedTxs& retries, ReadView const& check, FwdRange const& txs,
ApplyFlags flags, IHashRouter& router, OrderedTxs& retries, ApplyFlags flags,
Config const& config, beast::Journal j); HashRouter& router, Config const& config,
beast::Journal j);
private: private:
enum Result enum Result
@@ -158,36 +177,26 @@ private:
}; };
std::shared_ptr<OpenView> std::shared_ptr<OpenView>
create (std::shared_ptr< create (Rules const& rules,
Ledger const> const& ledger); std::shared_ptr<Ledger const> const& ledger);
static static
Result Result
apply_one (OpenView& view, std::shared_ptr< apply_one (Application& app, OpenView& view,
STTx const> const& tx, bool retry, std::shared_ptr< STTx const> const& tx,
ApplyFlags flags, IHashRouter& router, bool retry, ApplyFlags flags,
Config const& config, beast::Journal j); HashRouter& router, Config const& config,
beast::Journal j);
public:
//--------------------------------------------------------------------------
//
// TEST CODE
//
// Verify that the open ledger has the right contents
// This is called while holding the master and ledger master mutexes
bool
verify (Ledger const& ledger,
std::string const& suffix = "") const;
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
template <class FwdRange> template <class FwdRange>
void void
OpenLedger::apply (OpenView& view, OpenLedger::apply (Application& app, OpenView& view,
ReadView const& check, FwdRange const& txs, ReadView const& check, FwdRange const& txs,
OrderedTxs& retries, ApplyFlags flags, OrderedTxs& retries, ApplyFlags flags,
IHashRouter& router, Config const& config, HashRouter& router, Config const& config,
beast::Journal j) beast::Journal j)
{ {
for (auto iter = txs.begin(); for (auto iter = txs.begin();
@@ -200,7 +209,7 @@ OpenLedger::apply (OpenView& view,
auto const tx = *iter; auto const tx = *iter;
if (check.txExists(tx->getTransactionID())) if (check.txExists(tx->getTransactionID()))
continue; continue;
auto const result = apply_one(view, auto const result = apply_one(app, view,
tx, true, flags, router, config, j); tx, true, flags, router, config, j);
if (result == Result::retry) if (result == Result::retry)
retries.insert(tx); retries.insert(tx);
@@ -220,7 +229,7 @@ OpenLedger::apply (OpenView& view,
auto iter = retries.begin(); auto iter = retries.begin();
while (iter != retries.end()) while (iter != retries.end())
{ {
switch (apply_one(view, switch (apply_one(app, view,
iter->second, retry, flags, iter->second, retry, flags,
router, config, j)) router, config, j))
{ {

View File

@@ -28,9 +28,11 @@
namespace ripple { namespace ripple {
OrderBookDB::OrderBookDB (Stoppable& parent) OrderBookDB::OrderBookDB (Application& app, Stoppable& parent)
: Stoppable ("OrderBookDB", parent) : Stoppable ("OrderBookDB", parent)
, app_ (app)
, mSeq (0) , mSeq (0)
, j_ (app.journal ("OrderBookDB"))
{ {
} }
@@ -40,7 +42,8 @@ void OrderBookDB::invalidate ()
mSeq = 0; mSeq = 0;
} }
void OrderBookDB::setup (Ledger::ref ledger) void OrderBookDB::setup(
std::shared_ptr<ReadView const> const& ledger)
{ {
{ {
ScopedLockType sl (mLock); ScopedLockType sl (mLock);
@@ -57,35 +60,50 @@ void OrderBookDB::setup (Ledger::ref ledger)
return; return;
} }
WriteLog (lsDEBUG, OrderBookDB) JLOG (j_.debug)
<< "Advancing from " << mSeq << " to " << seq; << "Advancing from " << mSeq << " to " << seq;
mSeq = seq; mSeq = seq;
} }
if (getConfig().RUN_STANDALONE) if (app_.config().RUN_STANDALONE)
update(ledger); update(ledger);
else else
getApp().getJobQueue().addJob(jtUPDATE_PF, "OrderBookDB::update", app_.getJobQueue().addJob(
std::bind(&OrderBookDB::update, this, ledger)); jtUPDATE_PF, "OrderBookDB::update",
[this, ledger] (Job&) { update(ledger); });
} }
static void updateHelper (SLE::ref entry, void OrderBookDB::update(
hash_set< uint256 >& seen, std::shared_ptr<ReadView const> const& ledger)
OrderBookDB::IssueToOrderBook& destMap,
OrderBookDB::IssueToOrderBook& sourceMap,
hash_set< Issue >& XRPBooks,
int& books)
{ {
if (entry->getType () == ltDIR_NODE && hash_set< uint256 > seen;
entry->isFieldPresent (sfExchangeRate) && OrderBookDB::IssueToOrderBook destMap;
entry->getFieldH256 (sfRootIndex) == entry->getIndex()) OrderBookDB::IssueToOrderBook sourceMap;
hash_set< Issue > XRPBooks;
JLOG (j_.debug) << "OrderBookDB::update>";
// walk through the entire ledger looking for orderbook entries
int books = 0;
try
{
for(auto& sle : ledger->sles)
{
if (sle->getType () == ltDIR_NODE &&
sle->isFieldPresent (sfExchangeRate) &&
sle->getFieldH256 (sfRootIndex) == sle->getIndex())
{ {
Book book; Book book;
book.in.currency.copyFrom (entry->getFieldH160 (sfTakerPaysCurrency)); book.in.currency.copyFrom(sle->getFieldH160(
book.in.account.copyFrom (entry->getFieldH160 (sfTakerPaysIssuer)); sfTakerPaysCurrency));
book.out.account.copyFrom (entry->getFieldH160 (sfTakerGetsIssuer)); book.in.account.copyFrom(sle->getFieldH160 (
book.out.currency.copyFrom (entry->getFieldH160 (sfTakerGetsCurrency)); sfTakerPaysIssuer));
book.out.account.copyFrom(sle->getFieldH160(
sfTakerGetsIssuer));
book.out.currency.copyFrom (sle->getFieldH160(
sfTakerGetsCurrency));
uint256 index = getBookBase (book); uint256 index = getBookBase (book);
if (seen.insert (index).second) if (seen.insert (index).second)
@@ -98,36 +116,18 @@ static void updateHelper (SLE::ref entry,
++books; ++books;
} }
} }
} }
void OrderBookDB::update (Ledger::pointer ledger)
{
hash_set< uint256 > seen;
OrderBookDB::IssueToOrderBook destMap;
OrderBookDB::IssueToOrderBook sourceMap;
hash_set< Issue > XRPBooks;
WriteLog (lsDEBUG, OrderBookDB) << "OrderBookDB::update>";
// walk through the entire ledger looking for orderbook entries
int books = 0;
try
{
ledger->visitStateItems(std::bind(&updateHelper, std::placeholders::_1,
std::ref(seen), std::ref(destMap),
std::ref(sourceMap), std::ref(XRPBooks), std::ref(books)));
} }
catch (const SHAMapMissingNode&) catch (const SHAMapMissingNode&)
{ {
WriteLog (lsINFO, OrderBookDB) JLOG (j_.info)
<< "OrderBookDB::update encountered a missing node"; << "OrderBookDB::update encountered a missing node";
ScopedLockType sl (mLock); ScopedLockType sl (mLock);
mSeq = 0; mSeq = 0;
return; return;
} }
WriteLog (lsDEBUG, OrderBookDB) JLOG (j_.debug)
<< "OrderBookDB::update< " << books << " books found"; << "OrderBookDB::update< " << books << " books found";
{ {
ScopedLockType sl (mLock); ScopedLockType sl (mLock);
@@ -136,7 +136,7 @@ void OrderBookDB::update (Ledger::pointer ledger)
mSourceMap.swap(sourceMap); mSourceMap.swap(sourceMap);
mDestMap.swap(destMap); mDestMap.swap(destMap);
} }
getApp().getLedgerMaster().newOrderBookDB(); app_.getLedgerMaster().newOrderBookDB();
} }
void OrderBookDB::addOrderBook(Book const& book) void OrderBookDB::addOrderBook(Book const& book)
@@ -225,7 +225,8 @@ BookListeners::pointer OrderBookDB::getBookListeners (Book const& book)
// Based on the meta, send the meta to the streams that are listening. // Based on the meta, send the meta to the streams that are listening.
// We need to determine which streams a given meta effects. // We need to determine which streams a given meta effects.
void OrderBookDB::processTxn ( void OrderBookDB::processTxn (
Ledger::ref ledger, const AcceptedLedgerTx& alTx, Json::Value const& jvObj) std::shared_ptr<ReadView const> const& ledger,
const AcceptedLedgerTx& alTx, Json::Value const& jvObj)
{ {
ScopedLockType sl (mLock); ScopedLockType sl (mLock);
@@ -271,7 +272,7 @@ void OrderBookDB::processTxn (
} }
catch (...) catch (...)
{ {
WriteLog (lsINFO, OrderBookDB) JLOG (j_.info)
<< "Fields not found in OrderBookDB::processTxn"; << "Fields not found in OrderBookDB::processTxn";
} }
} }

View File

@@ -22,6 +22,7 @@
#include <ripple/app/ledger/AcceptedLedgerTx.h> #include <ripple/app/ledger/AcceptedLedgerTx.h>
#include <ripple/app/ledger/BookListeners.h> #include <ripple/app/ledger/BookListeners.h>
#include <ripple/app/main/Application.h>
#include <ripple/app/misc/OrderBook.h> #include <ripple/app/misc/OrderBook.h>
namespace ripple { namespace ripple {
@@ -30,10 +31,10 @@ class OrderBookDB
: public beast::Stoppable : public beast::Stoppable
{ {
public: public:
explicit OrderBookDB (Stoppable& parent); OrderBookDB (Application& app, Stoppable& parent);
void setup (Ledger::ref ledger); void setup (std::shared_ptr<ReadView const> const& ledger);
void update (Ledger::pointer ledger); void update (std::shared_ptr<ReadView const> const& ledger);
void invalidate (); void invalidate ();
void addOrderBook(Book const&); void addOrderBook(Book const&);
@@ -42,8 +43,8 @@ public:
*/ */
OrderBook::List getBooksByTakerPays (Issue const&); OrderBook::List getBooksByTakerPays (Issue const&);
/** @return a count of all orderbooks that want this issuerID and currencyID. /** @return a count of all orderbooks that want this issuerID and
*/ currencyID. */
int getBookSize(Issue const&); int getBookSize(Issue const&);
bool isBookToXRP (Issue const&); bool isBookToXRP (Issue const&);
@@ -53,14 +54,16 @@ public:
// see if this txn effects any orderbook // see if this txn effects any orderbook
void processTxn ( void processTxn (
Ledger::ref ledger, const AcceptedLedgerTx& alTx, std::shared_ptr<ReadView const> const& ledger,
Json::Value const& jvObj); const AcceptedLedgerTx& alTx, Json::Value const& jvObj);
using IssueToOrderBook = hash_map <Issue, OrderBook::List>; using IssueToOrderBook = hash_map <Issue, OrderBook::List>;
private: private:
void rawAddBook(Book const&); void rawAddBook(Book const&);
Application& app_;
// by ci/ii // by ci/ii
IssueToOrderBook mSourceMap; IssueToOrderBook mSourceMap;
@@ -79,6 +82,8 @@ private:
BookToListenersMap mListeners; BookToListenersMap mListeners;
std::uint32_t mSeq; std::uint32_t mSeq;
beast::Journal j_;
}; };
} // ripple } // ripple

View File

@@ -28,6 +28,11 @@
namespace ripple { namespace ripple {
TransactionStateSF::TransactionStateSF(Application& app)
: app_ (app)
{
}
// VFALCO This might be better as Blob&& // VFALCO This might be better as Blob&&
void TransactionStateSF::gotNode (bool fromFilter, void TransactionStateSF::gotNode (bool fromFilter,
SHAMapNodeID const& id, SHAMapNodeID const& id,
@@ -40,7 +45,7 @@ void TransactionStateSF::gotNode (bool fromFilter,
// and this should use that Database instad of getNodeStore // and this should use that Database instad of getNodeStore
assert(type != assert(type !=
SHAMapTreeNode::tnTRANSACTION_NM); SHAMapTreeNode::tnTRANSACTION_NM);
getApp().getNodeStore().store( app_.getNodeStore().store(
hotTRANSACTION_NODE, hotTRANSACTION_NODE,
std::move (nodeData), nodeHash); std::move (nodeData), nodeHash);
} }
@@ -49,7 +54,7 @@ bool TransactionStateSF::haveNode (SHAMapNodeID const& id,
uint256 const& nodeHash, uint256 const& nodeHash,
Blob& nodeData) Blob& nodeData)
{ {
return getApp().getLedgerMaster ().getFetchPack (nodeHash, nodeData); return app_.getLedgerMaster ().getFetchPack (nodeHash, nodeData);
} }
} // ripple } // ripple

View File

@@ -20,6 +20,7 @@
#ifndef RIPPLE_APP_LEDGER_TRANSACTIONSTATESF_H_INCLUDED #ifndef RIPPLE_APP_LEDGER_TRANSACTIONSTATESF_H_INCLUDED
#define RIPPLE_APP_LEDGER_TRANSACTIONSTATESF_H_INCLUDED #define RIPPLE_APP_LEDGER_TRANSACTIONSTATESF_H_INCLUDED
#include <ripple/app/main/Application.h>
#include <ripple/shamap/SHAMapSyncFilter.h> #include <ripple/shamap/SHAMapSyncFilter.h>
#include <cstdint> #include <cstdint>
@@ -30,8 +31,12 @@ namespace ripple {
class TransactionStateSF class TransactionStateSF
: public SHAMapSyncFilter : public SHAMapSyncFilter
{ {
private:
Application& app_;
public: public:
TransactionStateSF() = default; explicit
TransactionStateSF(Application& app);
// Note that the nodeData is overwritten by this call // Note that the nodeData is overwritten by this call
void gotNode (bool fromFilter, void gotNode (bool fromFilter,

View File

@@ -21,15 +21,15 @@
#include <ripple/app/ledger/LedgerTiming.h> #include <ripple/app/ledger/LedgerTiming.h>
#include <ripple/app/ledger/impl/ConsensusImp.h> #include <ripple/app/ledger/impl/ConsensusImp.h>
#include <ripple/app/ledger/impl/LedgerConsensusImp.h> #include <ripple/app/ledger/impl/LedgerConsensusImp.h>
#include <ripple/basics/Log.h>
#include <beast/utility/Journal.h>
namespace ripple { namespace ripple {
ConsensusImp::ConsensusImp () ConsensusImp::ConsensusImp (
: journal_ (deprecatedLogs().journal("Consensus")) FeeVote::Setup const& voteSetup,
, feeVote_ (make_FeeVote (setup_FeeVote (getConfig().section ("voting")), Logs& logs)
deprecatedLogs().journal("FeeVote"))) : journal_ (logs.journal("Consensus"))
, feeVote_ (make_FeeVote (voteSetup,
logs.journal("FeeVote")))
, proposing_ (false) , proposing_ (false)
, validating_ (false) , validating_ (false)
, lastCloseProposers_ (0) , lastCloseProposers_ (0)
@@ -65,6 +65,7 @@ ConsensusImp::getLastCloseDuration () const
std::shared_ptr<LedgerConsensus> std::shared_ptr<LedgerConsensus>
ConsensusImp::startRound ( ConsensusImp::startRound (
Application& app,
InboundTransactions& inboundTransactions, InboundTransactions& inboundTransactions,
LocalTxs& localtx, LocalTxs& localtx,
LedgerMaster& ledgerMaster, LedgerMaster& ledgerMaster,
@@ -72,7 +73,7 @@ ConsensusImp::startRound (
Ledger::ref previousLedger, Ledger::ref previousLedger,
std::uint32_t closeTime) std::uint32_t closeTime)
{ {
return make_LedgerConsensus (*this, lastCloseProposers_, return make_LedgerConsensus (app, *this, lastCloseProposers_,
lastCloseConvergeTook_, inboundTransactions, localtx, ledgerMaster, lastCloseConvergeTook_, inboundTransactions, localtx, ledgerMaster,
prevLCLHash, previousLedger, closeTime, *feeVote_); prevLCLHash, previousLedger, closeTime, *feeVote_);
} }
@@ -173,9 +174,11 @@ ConsensusImp::peekStoredProposals ()
//============================================================================== //==============================================================================
std::unique_ptr<Consensus> std::unique_ptr<Consensus>
make_Consensus () make_Consensus (Config const& config, Logs& logs)
{ {
return std::make_unique<ConsensusImp> (); return std::make_unique<ConsensusImp> (
setup_FeeVote (config.section ("voting")),
logs);
} }
} }

View File

@@ -24,6 +24,7 @@
#include <ripple/app/ledger/Consensus.h> #include <ripple/app/ledger/Consensus.h>
#include <ripple/app/ledger/LedgerConsensus.h> #include <ripple/app/ledger/LedgerConsensus.h>
#include <ripple/app/misc/FeeVote.h> #include <ripple/app/misc/FeeVote.h>
#include <ripple/basics/Log.h>
#include <ripple/protocol/STValidation.h> #include <ripple/protocol/STValidation.h>
#include <ripple/shamap/SHAMap.h> #include <ripple/shamap/SHAMap.h>
#include <beast/utility/Journal.h> #include <beast/utility/Journal.h>
@@ -35,7 +36,7 @@ class ConsensusImp
: public Consensus : public Consensus
{ {
public: public:
ConsensusImp (); ConsensusImp (FeeVote::Setup const& voteSetup, Logs& logs);
~ConsensusImp () = default; ~ConsensusImp () = default;
@@ -53,6 +54,7 @@ public:
std::shared_ptr<LedgerConsensus> std::shared_ptr<LedgerConsensus>
startRound ( startRound (
Application& app,
InboundTransactions& inboundTransactions, InboundTransactions& inboundTransactions,
LocalTxs& localtx, LocalTxs& localtx,
LedgerMaster& ledgerMaster, LedgerMaster& ledgerMaster,

View File

@@ -35,13 +35,13 @@ void DisputedTx::setVote (NodeID const& peer, bool votesYes)
{ {
if (votesYes) if (votesYes)
{ {
WriteLog (lsDEBUG, LedgerConsensus) JLOG (j_.debug)
<< "Peer " << peer << " votes YES on " << mTransactionID; << "Peer " << peer << " votes YES on " << mTransactionID;
++mYays; ++mYays;
} }
else else
{ {
WriteLog (lsDEBUG, LedgerConsensus) JLOG (j_.debug)
<< "Peer " << peer << " votes NO on " << mTransactionID; << "Peer " << peer << " votes NO on " << mTransactionID;
++mNays; ++mNays;
} }
@@ -49,7 +49,7 @@ void DisputedTx::setVote (NodeID const& peer, bool votesYes)
// changes vote to yes // changes vote to yes
else if (votesYes && !res.first->second) else if (votesYes && !res.first->second)
{ {
WriteLog (lsDEBUG, LedgerConsensus) JLOG (j_.debug)
<< "Peer " << peer << " now votes YES on " << mTransactionID; << "Peer " << peer << " now votes YES on " << mTransactionID;
--mNays; --mNays;
++mYays; ++mYays;
@@ -58,8 +58,8 @@ void DisputedTx::setVote (NodeID const& peer, bool votesYes)
// changes vote to no // changes vote to no
else if (!votesYes && res.first->second) else if (!votesYes && res.first->second)
{ {
WriteLog (lsDEBUG, LedgerConsensus) << "Peer " << peer JLOG (j_.debug)
<< " now votes NO on " << mTransactionID; << "Peer " << peer << " now votes NO on " << mTransactionID;
++mNays; ++mNays;
--mYays; --mYays;
res.first->second = false; res.first->second = false;
@@ -124,18 +124,18 @@ bool DisputedTx::updateVote (int percentTime, bool proposing)
if (newPosition == mOurVote) if (newPosition == mOurVote)
{ {
WriteLog (lsINFO, LedgerConsensus) JLOG (j_.info)
<< "No change (" << (mOurVote ? "YES" : "NO") << ") : weight " << "No change (" << (mOurVote ? "YES" : "NO") << ") : weight "
<< weight << ", percent " << percentTime; << weight << ", percent " << percentTime;
WriteLog (lsDEBUG, LedgerConsensus) << getJson (); JLOG (j_.debug) << getJson ();
return false; return false;
} }
mOurVote = newPosition; mOurVote = newPosition;
WriteLog (lsDEBUG, LedgerConsensus) JLOG (j_.debug)
<< "We now vote " << (mOurVote ? "YES" : "NO") << "We now vote " << (mOurVote ? "YES" : "NO")
<< " on " << mTransactionID; << " on " << mTransactionID;
WriteLog (lsDEBUG, LedgerConsensus) << getJson (); JLOG (j_.debug) << getJson ();
return true; return true;
} }

View File

@@ -23,6 +23,7 @@
#include <ripple/protocol/UintTypes.h> #include <ripple/protocol/UintTypes.h>
#include <ripple/protocol/Serializer.h> #include <ripple/protocol/Serializer.h>
#include <ripple/basics/base_uint.h> #include <ripple/basics/base_uint.h>
#include <beast/utility/Journal.h>
#include <memory> #include <memory>
namespace ripple { namespace ripple {
@@ -40,12 +41,13 @@ class DisputedTx
public: public:
// VFALCO `Blob` is a poor choice of parameter // VFALCO `Blob` is a poor choice of parameter
DisputedTx (uint256 const& txID, DisputedTx (uint256 const& txID,
Blob const& tx, bool ourVote) Blob const& tx, bool ourVote, beast::Journal j)
: mTransactionID (txID) : mTransactionID (txID)
, mYays (0) , mYays (0)
, mNays (0) , mNays (0)
, mOurVote (ourVote) , mOurVote (ourVote)
, transaction (tx.data(), tx.size()) , transaction (tx.data(), tx.size())
, j_ (j)
{ {
} }
@@ -71,8 +73,8 @@ public:
mOurVote = o; mOurVote = o;
} }
// VFALCO NOTE its not really a peer, its the 160 bit hash of the validator's public key // VFALCO NOTE its not really a peer, its the 160 bit hash of the
// // validator's public key.
void setVote (NodeID const& peer, bool votesYes); void setVote (NodeID const& peer, bool votesYes);
void unVote (NodeID const& peer); void unVote (NodeID const& peer);
@@ -88,6 +90,7 @@ private:
Serializer transaction; Serializer transaction;
hash_map <NodeID, bool> mVotes; hash_map <NodeID, bool> mVotes;
beast::Journal j_;
}; };
} // ripple } // ripple

View File

@@ -57,10 +57,10 @@ enum
,fetchSmallNodes = 32 ,fetchSmallNodes = 32
}; };
InboundLedger::InboundLedger (uint256 const& hash, std::uint32_t seq, fcReason reason, InboundLedger::InboundLedger (
clock_type& clock) Application& app, uint256 const& hash, std::uint32_t seq, fcReason reason, clock_type& clock)
: PeerSet (hash, ledgerAcquireTimeoutMillis, false, clock, : PeerSet (app, hash, ledgerAcquireTimeoutMillis, false, clock,
deprecatedLogs().journal("InboundLedger")) app.journal("InboundLedger"))
, mHaveHeader (false) , mHaveHeader (false)
, mHaveState (false) , mHaveState (false)
, mHaveTransactions (false) , mHaveTransactions (false)
@@ -72,7 +72,7 @@ InboundLedger::InboundLedger (uint256 const& hash, std::uint32_t seq, fcReason r
, mReceiveDispatched (false) , mReceiveDispatched (false)
{ {
if (m_journal.trace) m_journal.trace << JLOG (m_journal.trace) <<
"Acquiring ledger " << mHash; "Acquiring ledger " << mHash;
} }
@@ -109,7 +109,7 @@ InboundLedger::~InboundLedger ()
for (auto& entry : mReceivedData) for (auto& entry : mReceivedData)
{ {
if (entry.second->type () == protocol::liAS_NODE) if (entry.second->type () == protocol::liAS_NODE)
getApp().getInboundLedgers().gotStaleData(entry.second); app_.getInboundLedgers().gotStaleData(entry.second);
} }
} }
@@ -129,14 +129,18 @@ void InboundLedger::init (ScopedLockType& collectionLock)
if (m_journal.debug) m_journal.debug << if (m_journal.debug) m_journal.debug <<
"Acquiring ledger we already have locally: " << getHash (); "Acquiring ledger we already have locally: " << getHash ();
mLedger->setClosed (); mLedger->setClosed ();
mLedger->setImmutable (); mLedger->setImmutable (app_.config());
if (mReason != fcHISTORY) if (mReason != fcHISTORY)
getApp ().getLedgerMaster ().storeLedger (mLedger); app_.getLedgerMaster ().storeLedger (mLedger);
// Check if this could be a newer fully-validated ledger // Check if this could be a newer fully-validated ledger
if ((mReason == fcVALIDATION) || (mReason == fcCURRENT) || (mReason == fcCONSENSUS)) if (mReason == fcVALIDATION ||
getApp ().getLedgerMaster ().checkAccept (mLedger); mReason == fcCURRENT ||
mReason == fcCONSENSUS)
{
app_.getLedgerMaster ().checkAccept (mLedger);
}
} }
} }
@@ -150,26 +154,28 @@ bool InboundLedger::tryLocal ()
if (!mHaveHeader) if (!mHaveHeader)
{ {
// Nothing we can do without the ledger header // Nothing we can do without the ledger header
std::shared_ptr<NodeObject> node = getApp().getNodeStore ().fetch (mHash); auto node = app_.getNodeStore ().fetch (mHash);
if (!node) if (!node)
{ {
Blob data; Blob data;
if (!getApp().getLedgerMaster ().getFetchPack (mHash, data)) if (!app_.getLedgerMaster ().getFetchPack (mHash, data))
return false; return false;
if (m_journal.trace) m_journal.trace << if (m_journal.trace) m_journal.trace <<
"Ledger header found in fetch pack"; "Ledger header found in fetch pack";
mLedger = std::make_shared<Ledger> ( mLedger = std::make_shared<Ledger> (
data.data(), data.size(), true, getConfig()); data.data(), data.size(), true,
getApp().getNodeStore ().store ( app_.config(), app_.family());
app_.getNodeStore ().store (
hotLEDGER, std::move (data), mHash); hotLEDGER, std::move (data), mHash);
} }
else else
{ {
mLedger = std::make_shared<Ledger>( mLedger = std::make_shared<Ledger>(
node->getData().data(), node->getData().size(), true, getConfig()); node->getData().data(), node->getData().size(),
true, app_.config(), app_.family());
} }
if (mLedger->getHash () != mHash) if (mLedger->getHash () != mHash)
@@ -194,7 +200,7 @@ bool InboundLedger::tryLocal ()
} }
else else
{ {
TransactionStateSF filter; TransactionStateSF filter(app_);
if (mLedger->txMap().fetchRoot ( if (mLedger->txMap().fetchRoot (
mLedger->info().txHash, &filter)) mLedger->info().txHash, &filter))
@@ -222,7 +228,7 @@ bool InboundLedger::tryLocal ()
} }
else else
{ {
AccountStateSF filter; AccountStateSF filter(app_);
if (mLedger->stateMap().fetchRoot ( if (mLedger->stateMap().fetchRoot (
mLedger->info().accountHash, &filter)) mLedger->info().accountHash, &filter))
@@ -245,7 +251,7 @@ bool InboundLedger::tryLocal ()
"Had everything locally"; "Had everything locally";
mComplete = true; mComplete = true;
mLedger->setClosed (); mLedger->setClosed ();
mLedger->setImmutable (); mLedger->setImmutable (app_.config());
} }
return mComplete; return mComplete;
@@ -289,7 +295,7 @@ void InboundLedger::onTimer (bool wasProgress, ScopedLockType&)
mByHash = true; mByHash = true;
std::size_t pc = getPeerCount (); std::size_t pc = getPeerCount ();
WriteLog (lsDEBUG, InboundLedger) << JLOG (m_journal.debug) <<
"No progress(" << pc << "No progress(" << pc <<
") for ledger " << mHash; ") for ledger " << mHash;
@@ -308,7 +314,7 @@ void InboundLedger::onTimer (bool wasProgress, ScopedLockType&)
/** Add more peers to the set, if possible */ /** Add more peers to the set, if possible */
void InboundLedger::addPeers () void InboundLedger::addPeers ()
{ {
getApp().overlay().selectPeers (*this, app_.overlay().selectPeers (*this,
(getPeerCount() > 0) ? peerCountStart : peerCountAdd, (getPeerCount() > 0) ? peerCountStart : peerCountAdd,
ScoreHasLedger (getHash(), mSeq)); ScoreHasLedger (getHash(), mSeq));
} }
@@ -321,17 +327,16 @@ std::weak_ptr<PeerSet> InboundLedger::pmDowncast ()
/** Dispatch acquire completion /** Dispatch acquire completion
*/ */
static void LADispatch ( static void LADispatch (
Job& job,
InboundLedger::pointer la, InboundLedger::pointer la,
std::vector< std::function<void (InboundLedger::pointer)> > trig) std::vector< std::function<void (InboundLedger::pointer)> > trig)
{ {
if (la->isComplete() && !la->isFailed()) if (la->isComplete() && !la->isFailed())
{ {
getApp().getLedgerMaster().checkAccept(la->getLedger()); la->app().getLedgerMaster().checkAccept(la->getLedger());
getApp().getLedgerMaster().tryAdvance(); la->app().getLedgerMaster().tryAdvance();
} }
else else
getApp().getInboundLedgers().logFailure (la->getHash(), la->getSeq()); la->app().getInboundLedgers().logFailure (la->getHash(), la->getSeq());
for (unsigned int i = 0; i < trig.size (); ++i) for (unsigned int i = 0; i < trig.size (); ++i)
trig[i] (la); trig[i] (la);
@@ -359,16 +364,17 @@ void InboundLedger::done ()
if (isComplete () && !isFailed () && mLedger) if (isComplete () && !isFailed () && mLedger)
{ {
mLedger->setClosed (); mLedger->setClosed ();
mLedger->setImmutable (); mLedger->setImmutable (app_.config());
if (mReason != fcHISTORY) if (mReason != fcHISTORY)
getApp().getLedgerMaster ().storeLedger (mLedger); app_.getLedgerMaster ().storeLedger (mLedger);
getApp().getInboundLedgers().onLedgerFetched(mReason); app_.getInboundLedgers().onLedgerFetched(mReason);
} }
// We hold the PeerSet lock, so must dispatch // We hold the PeerSet lock, so must dispatch
getApp().getJobQueue ().addJob (jtLEDGER_DATA, "triggers", auto that = shared_from_this ();
std::bind (LADispatch, std::placeholders::_1, shared_from_this (), app_.getJobQueue ().addJob (
triggers)); jtLEDGER_DATA, "triggers",
[that, triggers] (Job&) { LADispatch(that, triggers); });
} }
bool InboundLedger::addOnComplete ( bool InboundLedger::addOnComplete (
@@ -466,11 +472,11 @@ void InboundLedger::trigger (Peer::ptr const& peer)
Message::pointer packet (std::make_shared <Message> ( Message::pointer packet (std::make_shared <Message> (
tmBH, protocol::mtGET_OBJECTS)); tmBH, protocol::mtGET_OBJECTS));
{ {
for (PeerSetMap::iterator it = mPeers.begin (), end = mPeers.end (); for (auto it = mPeers.begin (), end = mPeers .end ();
it != end; ++it) it != end; ++it)
{ {
Peer::ptr iPeer ( Peer::ptr iPeer (
getApp().overlay ().findPeerByShortID (it->first)); app_.overlay ().findPeerByShortID (it->first));
if (iPeer) if (iPeer)
{ {
@@ -499,8 +505,9 @@ void InboundLedger::trigger (Peer::ptr const& peer)
if (!mHaveHeader && !mFailed) if (!mHaveHeader && !mFailed)
{ {
tmGL.set_itype (protocol::liBASE); tmGL.set_itype (protocol::liBASE);
if (m_journal.trace) m_journal.trace << if (m_journal.trace) m_journal.trace
"Sending header request to " << (peer ? "selected peer" : "all peers"); << "Sending header request to "
<< (peer ? "selected peer" : "all peers");
sendRequest (tmGL, peer); sendRequest (tmGL, peer);
return; return;
} }
@@ -529,8 +536,9 @@ void InboundLedger::trigger (Peer::ptr const& peer)
// we need the root node // we need the root node
tmGL.set_itype (protocol::liAS_NODE); tmGL.set_itype (protocol::liAS_NODE);
*tmGL.add_nodeids () = SHAMapNodeID ().getRawString (); *tmGL.add_nodeids () = SHAMapNodeID ().getRawString ();
if (m_journal.trace) m_journal.trace << if (m_journal.trace) m_journal.trace
"Sending AS root request to " << (peer ? "selected peer" : "all peers"); << "Sending AS root request to "
<< (peer ? "selected peer" : "all peers");
sendRequest (tmGL, peer); sendRequest (tmGL, peer);
return; return;
} }
@@ -541,7 +549,7 @@ void InboundLedger::trigger (Peer::ptr const& peer)
// VFALCO Why 256? Make this a constant // VFALCO Why 256? Make this a constant
nodeIDs.reserve (256); nodeIDs.reserve (256);
nodeHashes.reserve (256); nodeHashes.reserve (256);
AccountStateSF filter; AccountStateSF filter(app_);
// Release the lock while we process the large state map // Release the lock while we process the large state map
sl.unlock(); sl.unlock();
@@ -587,8 +595,8 @@ void InboundLedger::trigger (Peer::ptr const& peer)
"Sending AS node " << nodeIDs.size () << "Sending AS node " << nodeIDs.size () <<
" request to " << ( " request to " << (
peer ? "selected peer" : "all peers"); peer ? "selected peer" : "all peers");
if (nodeIDs.size () == 1 && m_journal.trace) m_journal.trace << if (nodeIDs.size () == 1 && m_journal.trace)
"AS node: " << nodeIDs[0]; m_journal.trace << "AS node: " << nodeIDs[0];
sendRequest (tmGL, peer); sendRequest (tmGL, peer);
return; return;
} }
@@ -625,7 +633,7 @@ void InboundLedger::trigger (Peer::ptr const& peer)
std::vector<uint256> nodeHashes; std::vector<uint256> nodeHashes;
nodeIDs.reserve (256); nodeIDs.reserve (256);
nodeHashes.reserve (256); nodeHashes.reserve (256);
TransactionStateSF filter; TransactionStateSF filter(app_);
mLedger->txMap().getMissingNodes ( mLedger->txMap().getMissingNodes (
nodeIDs, nodeHashes, 256, &filter); nodeIDs, nodeHashes, 256, &filter);
@@ -762,7 +770,8 @@ bool InboundLedger::takeHeader (std::string const& data)
return true; return true;
mLedger = std::make_shared<Ledger>( mLedger = std::make_shared<Ledger>(
data.data(), data.size(), false, getConfig()); data.data(), data.size(), false,
app_.config(), app_.family());
if (mLedger->getHash () != mHash) if (mLedger->getHash () != mHash)
{ {
@@ -779,7 +788,7 @@ bool InboundLedger::takeHeader (std::string const& data)
Serializer s (data.size () + 4); Serializer s (data.size () + 4);
s.add32 (HashPrefix::ledgerMaster); s.add32 (HashPrefix::ledgerMaster);
s.addRaw (data.data(), data.size()); s.addRaw (data.data(), data.size());
getApp().getNodeStore ().store ( app_.getNodeStore ().store (
hotLEDGER, std::move (s.modData ()), mHash); hotLEDGER, std::move (s.modData ()), mHash);
progress (); progress ();
@@ -816,7 +825,7 @@ bool InboundLedger::takeTxNode (const std::vector<SHAMapNodeID>& nodeIDs,
auto nodeIDit = nodeIDs.cbegin (); auto nodeIDit = nodeIDs.cbegin ();
auto nodeDatait = data.begin (); auto nodeDatait = data.begin ();
TransactionStateSF tFilter; TransactionStateSF tFilter(app_);
while (nodeIDit != nodeIDs.cend ()) while (nodeIDit != nodeIDs.cend ())
{ {
@@ -883,7 +892,7 @@ bool InboundLedger::takeAsNode (const std::vector<SHAMapNodeID>& nodeIDs,
auto nodeIDit = nodeIDs.cbegin (); auto nodeIDit = nodeIDs.cbegin ();
auto nodeDatait = data.begin (); auto nodeDatait = data.begin ();
AccountStateSF tFilter; AccountStateSF tFilter(app_);
while (nodeIDit != nodeIDs.cend ()) while (nodeIDit != nodeIDs.cend ())
{ {
@@ -947,7 +956,7 @@ bool InboundLedger::takeAsRootNode (Blob const& data, SHAMapAddNode& san)
return false; return false;
} }
AccountStateSF tFilter; AccountStateSF tFilter(app_);
san += mLedger->stateMap().addRootNode ( san += mLedger->stateMap().addRootNode (
mLedger->info().accountHash, data, snfWIRE, &tFilter); mLedger->info().accountHash, data, snfWIRE, &tFilter);
return san.isGood(); return san.isGood();
@@ -971,7 +980,7 @@ bool InboundLedger::takeTxRootNode (Blob const& data, SHAMapAddNode& san)
return false; return false;
} }
TransactionStateSF tFilter; TransactionStateSF tFilter(app_);
san += mLedger->txMap().addRootNode ( san += mLedger->txMap().addRootNode (
mLedger->info().txHash, data, snfWIRE, &tFilter); mLedger->info().txHash, data, snfWIRE, &tFilter);
return san.isGood(); return san.isGood();
@@ -990,7 +999,7 @@ std::vector<InboundLedger::neededHash_t> InboundLedger::getNeededHashes ()
if (!mHaveState) if (!mHaveState)
{ {
AccountStateSF filter; AccountStateSF filter(app_);
// VFALCO NOTE What's the number 4? // VFALCO NOTE What's the number 4?
for (auto const& h : mLedger->getNeededAccountStateHashes (4, &filter)) for (auto const& h : mLedger->getNeededAccountStateHashes (4, &filter))
{ {
@@ -1001,7 +1010,7 @@ std::vector<InboundLedger::neededHash_t> InboundLedger::getNeededHashes ()
if (!mHaveTransactions) if (!mHaveTransactions)
{ {
TransactionStateSF filter; TransactionStateSF filter(app_);
// VFALCO NOTE What's the number 4? // VFALCO NOTE What's the number 4?
for (auto const& h : mLedger->getNeededTransactionHashes (4, &filter)) for (auto const& h : mLedger->getNeededTransactionHashes (4, &filter))
{ {

View File

@@ -37,26 +37,31 @@ class InboundLedgersImp
, public beast::Stoppable , public beast::Stoppable
{ {
private: private:
Application& app_;
std::mutex fetchRateMutex_; std::mutex fetchRateMutex_;
// measures ledgers per second, constants are important // measures ledgers per second, constants are important
DecayWindow<30, clock_type> fetchRate_; DecayWindow<30, clock_type> fetchRate_;
beast::Journal j_;
public: public:
using u256_acq_pair = std::pair<uint256, InboundLedger::pointer>; using u256_acq_pair = std::pair<uint256, InboundLedger::pointer>;
// How long before we try again to acquire the same ledger // How long before we try again to acquire the same ledger
static const std::chrono::minutes kReacquireInterval; static const std::chrono::minutes kReacquireInterval;
InboundLedgersImp (clock_type& clock, Stoppable& parent, InboundLedgersImp (Application& app, clock_type& clock, Stoppable& parent,
beast::insight::Collector::ptr const& collector) beast::insight::Collector::ptr const& collector)
: Stoppable ("InboundLedgers", parent) : Stoppable ("InboundLedgers", parent)
, app_ (app)
, fetchRate_(clock.now()) , fetchRate_(clock.now())
, j_ (app.journal ("InboundLedger"))
, m_clock (clock) , m_clock (clock)
, mRecentFailures (clock) , mRecentFailures (clock)
, mCounter(collector->make_counter("ledger_fetches")) , mCounter(collector->make_counter("ledger_fetches"))
{ {
} }
Ledger::pointer acquire (uint256 const& hash, std::uint32_t seq, InboundLedger::fcReason reason) Ledger::pointer acquire (
uint256 const& hash, std::uint32_t seq, InboundLedger::fcReason reason)
{ {
assert (hash.isNonZero ()); assert (hash.isNonZero ());
bool isNew = true; bool isNew = true;
@@ -74,7 +79,7 @@ public:
} }
else else
{ {
inbound = std::make_shared <InboundLedger> ( inbound = std::make_shared <InboundLedger> (app_,
hash, seq, reason, std::ref (m_clock)); hash, seq, reason, std::ref (m_clock));
mLedgers.emplace (hash, inbound); mLedgers.emplace (hash, inbound);
inbound->init (sl); inbound->init (sl);
@@ -99,7 +104,8 @@ public:
{ {
ScopedLockType sl (mLock); ScopedLockType sl (mLock);
hash_map<uint256, InboundLedger::pointer>::iterator it = mLedgers.find (hash); auto it = mLedgers.
find (hash);
if (it != mLedgers.end ()) if (it != mLedgers.end ())
{ {
ret = it->second; ret = it->second;
@@ -147,19 +153,24 @@ public:
{ {
protocol::TMLedgerData& packet = *packet_ptr; protocol::TMLedgerData& packet = *packet_ptr;
WriteLog (lsTRACE, InboundLedger) << "Got data (" << packet.nodes ().size () << ") for acquiring ledger: " << hash; JLOG (j_.trace)
<< "Got data (" << packet.nodes ().size ()
<< ") for acquiring ledger: " << hash;
InboundLedger::pointer ledger = find (hash); InboundLedger::pointer ledger = find (hash);
if (!ledger) if (!ledger)
{ {
WriteLog (lsTRACE, InboundLedger) << "Got data for ledger we're no longer acquiring"; JLOG (j_.trace)
<< "Got data for ledger we're no longer acquiring";
// If it's state node data, stash it because it still might be useful // If it's state node data, stash it because it still might be
// useful.
if (packet.type () == protocol::liAS_NODE) if (packet.type () == protocol::liAS_NODE)
{ {
getApp().getJobQueue().addJob(jtLEDGER_DATA, "gotStaleData", app_.getJobQueue().addJob(
std::bind(&InboundLedgers::gotStaleData, this, packet_ptr)); jtLEDGER_DATA, "gotStaleData",
[this, packet_ptr] (Job&) { gotStaleData(packet_ptr); });
} }
return false; return false;
@@ -167,9 +178,9 @@ public:
// Stash the data for later processing and see if we need to dispatch // Stash the data for later processing and see if we need to dispatch
if (ledger->gotData(std::weak_ptr<Peer>(peer), packet_ptr)) if (ledger->gotData(std::weak_ptr<Peer>(peer), packet_ptr))
getApp().getJobQueue().addJob (jtLEDGER_DATA, "processLedgerData", app_.getJobQueue().addJob (
std::bind (&InboundLedgers::doLedgerData, this, jtLEDGER_DATA, "processLedgerData",
std::placeholders::_1, hash)); [this, hash] (Job&) { doLedgerData(hash); });
return true; return true;
} }
@@ -217,7 +228,7 @@ public:
return mRecentFailures.find (h) != mRecentFailures.end(); return mRecentFailures.find (h) != mRecentFailures.end();
} }
void doLedgerData (Job&, LedgerHash hash) void doLedgerData (LedgerHash hash)
{ {
InboundLedger::pointer ledger = find (hash); InboundLedger::pointer ledger = find (hash);
@@ -225,9 +236,11 @@ public:
ledger->runData (); ledger->runData ();
} }
/** We got some data for a ledger we are no longer acquiring /** We got some data for a ledger we are no longer acquiring Since we paid
Since we paid the price to receive it, we might as well stash it in case we need it. the price to receive it, we might as well stash it in case we need it.
Nodes are received in wire format and must be stashed/hashed in prefix format
Nodes are received in wire format and must be stashed/hashed in prefix
format
*/ */
void gotStaleData (std::shared_ptr<protocol::TMLedgerData> packet_ptr) void gotStaleData (std::shared_ptr<protocol::TMLedgerData> packet_ptr)
{ {
@@ -244,7 +257,7 @@ public:
auto newNode = SHAMapAbstractNode::make( auto newNode = SHAMapAbstractNode::make(
Blob (node.nodedata().begin(), node.nodedata().end()), Blob (node.nodedata().begin(), node.nodedata().end()),
0, snfWIRE, uZero, false); 0, snfWIRE, uZero, false, app_.journal ("SHAMapNodeID"));
if (!newNode) if (!newNode)
return; return;
@@ -254,7 +267,8 @@ public:
auto blob = std::make_shared<Blob> (s.begin(), s.end()); auto blob = std::make_shared<Blob> (s.begin(), s.end());
getApp().getLedgerMaster().addFetchPack (newNode->getNodeHash(), blob); app_.getLedgerMaster().addFetchPack(
newNode->getNodeHash(), blob);
} }
} }
catch (...) catch (...)
@@ -317,7 +331,7 @@ public:
// getJson is expensive, so call without the lock // getJson is expensive, so call without the lock
std::uint32_t seq = it.second->getSeq(); std::uint32_t seq = it.second->getSeq();
if (seq > 1) if (seq > 1)
ret[beast::lexicalCastThrow <std::string>(seq)] = it.second->getJson(0); ret[std::to_string(seq)] = it.second->getJson(0);
else else
ret[to_string (it.first)] = it.second->getJson(0); ret[to_string (it.first)] = it.second->getJson(0);
} }
@@ -325,7 +339,7 @@ public:
return ret; return ret;
} }
void gotFetchPack (Job&) void gotFetchPack ()
{ {
std::vector<InboundLedger::pointer> acquires; std::vector<InboundLedger::pointer> acquires;
{ {
@@ -365,7 +379,8 @@ public:
it->second->touch (); it->second->touch ();
++it; ++it;
} }
else if ((it->second->getLastAction () + std::chrono::minutes (1)) < now) else if ((it->second->getLastAction () +
std::chrono::minutes (1)) < now)
{ {
stuffToSweep.push_back (it->second); stuffToSweep.push_back (it->second);
// shouldn't cause the actual final delete // shouldn't cause the actual final delete
@@ -382,7 +397,7 @@ public:
} }
WriteLog (lsDEBUG, InboundLedger) << JLOG (j_.debug) <<
"Swept " << stuffToSweep.size () << "Swept " << stuffToSweep.size () <<
" out of " << total << " inbound ledgers."; " out of " << total << " inbound ledgers.";
} }
@@ -414,17 +429,19 @@ private:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
decltype(InboundLedgersImp::kReacquireInterval) InboundLedgersImp::kReacquireInterval{5}; decltype(InboundLedgersImp::kReacquireInterval)
InboundLedgersImp::kReacquireInterval{5};
InboundLedgers::~InboundLedgers() InboundLedgers::~InboundLedgers()
{ {
} }
std::unique_ptr<InboundLedgers> std::unique_ptr<InboundLedgers>
make_InboundLedgers (InboundLedgers::clock_type& clock, beast::Stoppable& parent, make_InboundLedgers (Application& app,
InboundLedgers::clock_type& clock, beast::Stoppable& parent,
beast::insight::Collector::ptr const& collector) beast::insight::Collector::ptr const& collector)
{ {
return std::make_unique<InboundLedgersImp> (clock, parent, collector); return std::make_unique<InboundLedgersImp> (app, clock, parent, collector);
} }
} // ripple } // ripple

View File

@@ -63,25 +63,37 @@ public:
{ {
} }
LedgerIndex minRange; // The lowest ledger in the range we're checking // The lowest ledger in the range we're checking.
LedgerIndex maxRange; // The highest ledger in the range we're checking LedgerIndex minRange;
bool checkNodes; // Check all state/transaction nodes
bool fixTxns; // Rewrite SQL databases // The highest ledger in the range we're checking
int failures; // Number of errors encountered since last success LedgerIndex maxRange;
// Check all state/transaction nodes
bool checkNodes;
// Rewrite SQL databases
bool fixTxns;
// Number of errors encountered since last success
int failures;
}; };
using SharedState = beast::SharedData <State>; using SharedState = beast::SharedData <State>;
Application& app_;
SharedState m_state; SharedState m_state;
beast::Journal m_journal; beast::Journal m_journal;
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
LedgerCleanerImp ( LedgerCleanerImp (
Application& app,
Stoppable& stoppable, Stoppable& stoppable,
beast::Journal journal) beast::Journal journal)
: LedgerCleaner (stoppable) : LedgerCleaner (stoppable)
, Thread ("LedgerCleaner") , Thread ("LedgerCleaner")
, app_ (app)
, m_journal (journal) , m_journal (journal)
{ {
} }
@@ -147,7 +159,7 @@ public:
{ {
LedgerIndex minRange; LedgerIndex minRange;
LedgerIndex maxRange; LedgerIndex maxRange;
getApp().getLedgerMaster().getFullValidatedRange (minRange, maxRange); app_.getLedgerMaster().getFullValidatedRange (minRange, maxRange);
{ {
SharedState::Access state (m_state); SharedState::Access state (m_state);
@@ -174,7 +186,7 @@ public:
ledger numbers to clean. If unspecified, clean all ledgers. ledger numbers to clean. If unspecified, clean all ledgers.
"full" "full"
A boolean. When set to true, means clean everything possible. A boolean. When true, means clean everything possible.
"fix_txns" "fix_txns"
A boolean value indicating whether or not to fix the A boolean value indicating whether or not to fix the
@@ -184,7 +196,7 @@ public:
A boolean, when set to true means check the nodes. A boolean, when set to true means check the nodes.
"stop" "stop"
A boolean, when set to true informs the cleaner to gracefully A boolean, when true informs the cleaner to gracefully
stop its current activities if any cleaning is taking place. stop its current activities if any cleaning is taking place.
*/ */
@@ -260,8 +272,9 @@ public:
{ {
m_journal.warning << m_journal.warning <<
"Node missing from ledger " << ledger->info().seq; "Node missing from ledger " << ledger->info().seq;
getApp().getInboundLedgers().acquire ( app_.getInboundLedgers().acquire (
ledger->getHash(), ledger->info().seq, InboundLedger::fcGENERIC); ledger->getHash(), ledger->info().seq,
InboundLedger::fcGENERIC);
} }
return hash ? *hash : zero; // kludge return hash ? *hash : zero; // kludge
} }
@@ -280,7 +293,7 @@ public:
bool doTxns) bool doTxns)
{ {
Ledger::pointer nodeLedger = Ledger::pointer nodeLedger =
getApp().getInboundLedgers().acquire ( app_.getInboundLedgers().acquire (
ledgerHash, ledgerIndex, InboundLedger::fcGENERIC); ledgerHash, ledgerIndex, InboundLedger::fcGENERIC);
if (!nodeLedger) if (!nodeLedger)
{ {
@@ -288,7 +301,7 @@ public:
return false; return false;
} }
Ledger::pointer dbLedger = Ledger::loadByIndex(ledgerIndex); Ledger::pointer dbLedger = loadByIndex(ledgerIndex, app_);
if (! dbLedger || if (! dbLedger ||
(dbLedger->getHash() != ledgerHash) || (dbLedger->getHash() != ledgerHash) ||
(dbLedger->info().parentHash != nodeLedger->info().parentHash)) (dbLedger->info().parentHash != nodeLedger->info().parentHash))
@@ -299,21 +312,22 @@ public:
doTxns = true; doTxns = true;
} }
if(! getApp().getLedgerMaster().fixIndex(ledgerIndex, ledgerHash)) if(! app_.getLedgerMaster().fixIndex(ledgerIndex, ledgerHash))
{ {
m_journal.debug << "ledger " << ledgerIndex << " had wrong entry in history"; m_journal.debug << "ledger " << ledgerIndex
<< " had wrong entry in history";
doTxns = true; doTxns = true;
} }
if (doNodes && !nodeLedger->walkLedger()) if (doNodes && !nodeLedger->walkLedger(app_.journal ("Ledger")))
{ {
m_journal.debug << "Ledger " << ledgerIndex << " is missing nodes"; m_journal.debug << "Ledger " << ledgerIndex << " is missing nodes";
getApp().getInboundLedgers().acquire( app_.getInboundLedgers().acquire(
ledgerHash, ledgerIndex, InboundLedger::fcGENERIC); ledgerHash, ledgerIndex, InboundLedger::fcGENERIC);
return false; return false;
} }
if (doTxns && !nodeLedger->pendSaveValidated(true, false)) if (doTxns && !pendSaveValidated(app_, nodeLedger, true, false))
{ {
m_journal.debug << "Failed to save ledger " << ledgerIndex; m_journal.debug << "Failed to save ledger " << ledgerIndex;
return false; return false;
@@ -335,7 +349,7 @@ public:
if (!referenceLedger || (referenceLedger->info().seq < ledgerIndex)) if (!referenceLedger || (referenceLedger->info().seq < ledgerIndex))
{ {
referenceLedger = getApp().getLedgerMaster().getValidatedLedger(); referenceLedger = app_.getLedgerMaster().getValidatedLedger();
if (!referenceLedger) if (!referenceLedger)
{ {
m_journal.warning << "No validated ledger"; m_journal.warning << "No validated ledger";
@@ -349,8 +363,9 @@ public:
ledgerHash = getLedgerHash(referenceLedger, ledgerIndex); ledgerHash = getLedgerHash(referenceLedger, ledgerIndex);
if (ledgerHash.isZero()) if (ledgerHash.isZero())
{ {
// No, Try to get another ledger that might have the hash we need // No. Try to get another ledger that might have the hash we
// Compute the index and hash of a ledger that will have the hash we need // need: compute the index and hash of a ledger that will have
// the hash we need.
LedgerIndex refIndex = getCandidateLedger (ledgerIndex); LedgerIndex refIndex = getCandidateLedger (ledgerIndex);
LedgerHash refHash = getLedgerHash (referenceLedger, refIndex); LedgerHash refHash = getLedgerHash (referenceLedger, refIndex);
@@ -358,12 +373,14 @@ public:
assert (nonzero); assert (nonzero);
if (nonzero) if (nonzero)
{ {
// We found the hash and sequence of a better reference ledger // We found the hash and sequence of a better reference
// ledger.
referenceLedger = referenceLedger =
getApp().getInboundLedgers().acquire( app_.getInboundLedgers().acquire(
refHash, refIndex, InboundLedger::fcGENERIC); refHash, refIndex, InboundLedger::fcGENERIC);
if (referenceLedger) if (referenceLedger)
ledgerHash = getLedgerHash(referenceLedger, ledgerIndex); ledgerHash = getLedgerHash(
referenceLedger, ledgerIndex);
} }
} }
} }
@@ -385,7 +402,7 @@ public:
bool doNodes; bool doNodes;
bool doTxns; bool doTxns;
while (getApp().getFeeTrack().isLoadedLocal()) while (app_.getFeeTrack().isLoadedLocal())
{ {
m_journal.debug << "Waiting for load to subside"; m_journal.debug << "Waiting for load to subside";
std::this_thread::sleep_for(std::chrono::seconds(5)); std::this_thread::sleep_for(std::chrono::seconds(5));
@@ -411,7 +428,8 @@ public:
bool fail = false; bool fail = false;
if (ledgerHash.isZero()) if (ledgerHash.isZero())
{ {
m_journal.info << "Unable to get hash for ledger " << ledgerIndex; m_journal.info << "Unable to get hash for ledger "
<< ledgerIndex;
fail = true; fail = true;
} }
else if (!doLedger(ledgerIndex, ledgerHash, doNodes, doTxns)) else if (!doLedger(ledgerIndex, ledgerHash, doNodes, doTxns))
@@ -460,9 +478,10 @@ LedgerCleaner::~LedgerCleaner ()
} }
std::unique_ptr<LedgerCleaner> std::unique_ptr<LedgerCleaner>
make_LedgerCleaner (beast::Stoppable& parent, beast::Journal journal) make_LedgerCleaner (Application& app,
beast::Stoppable& parent, beast::Journal journal)
{ {
return std::make_unique <LedgerCleanerImp> (parent, journal); return std::make_unique<LedgerCleanerImp>(app, parent, journal);
} }
} // ripple } // ripple

View File

@@ -20,6 +20,7 @@
#ifndef RIPPLE_APP_LEDGER_LEDGERCLEANER_H_INCLUDED #ifndef RIPPLE_APP_LEDGER_LEDGERCLEANER_H_INCLUDED
#define RIPPLE_APP_LEDGER_LEDGERCLEANER_H_INCLUDED #define RIPPLE_APP_LEDGER_LEDGERCLEANER_H_INCLUDED
#include <ripple/app/main/Application.h>
#include <ripple/json/json_value.h> #include <ripple/json/json_value.h>
#include <beast/threads/Stoppable.h> #include <beast/threads/Stoppable.h>
#include <beast/utility/PropertyStream.h> #include <beast/utility/PropertyStream.h>
@@ -53,8 +54,9 @@ public:
virtual void doClean (Json::Value const& parameters) = 0; virtual void doClean (Json::Value const& parameters) = 0;
}; };
std::unique_ptr<LedgerCleaner> make_LedgerCleaner (beast::Stoppable& parent, std::unique_ptr<LedgerCleaner>
beast::Journal journal); make_LedgerCleaner (Application& app,
beast::Stoppable& parent, beast::Journal journal);
} // ripple } // ripple

File diff suppressed because it is too large Load Diff

View File

@@ -24,6 +24,7 @@
#include <ripple/app/ledger/LedgerMaster.h> #include <ripple/app/ledger/LedgerMaster.h>
#include <ripple/app/ledger/impl/ConsensusImp.h> #include <ripple/app/ledger/impl/ConsensusImp.h>
#include <ripple/app/ledger/impl/DisputedTx.h> #include <ripple/app/ledger/impl/DisputedTx.h>
#include <ripple/app/main/Application.h>
#include <ripple/app/misc/CanonicalTXSet.h> #include <ripple/app/misc/CanonicalTXSet.h>
#include <ripple/app/misc/FeeVote.h> #include <ripple/app/misc/FeeVote.h>
#include <ripple/basics/CountedObject.h> #include <ripple/basics/CountedObject.h>
@@ -92,6 +93,7 @@ public:
@param feeVote Our desired fee levels and voting logic. @param feeVote Our desired fee levels and voting logic.
*/ */
LedgerConsensusImp ( LedgerConsensusImp (
Application& app,
ConsensusImp& consensus, ConsensusImp& consensus,
int previousProposers, int previousProposers,
int previousConvergeTime, int previousConvergeTime,
@@ -259,7 +261,7 @@ private:
@param initialLedger The ledger that contains our initial position. @param initialLedger The ledger that contains our initial position.
*/ */
void takeInitialPosition (Ledger& initialLedger); void takeInitialPosition (std::shared_ptr<ReadView const> const& initialLedger);
/** /**
Called while trying to avalanche towards consensus. Called while trying to avalanche towards consensus.
@@ -292,6 +294,7 @@ private:
void addLoad(STValidation::ref val); void addLoad(STValidation::ref val);
private: private:
Application& app_;
ConsensusImp& consensus_; ConsensusImp& consensus_;
InboundTransactions& inboundTransactions_; InboundTransactions& inboundTransactions_;
LocalTxs& m_localTX; LocalTxs& m_localTX;
@@ -337,15 +340,17 @@ private:
// nodes that have bowed out of this consensus process // nodes that have bowed out of this consensus process
hash_set<NodeID> mDeadNodes; hash_set<NodeID> mDeadNodes;
beast::Journal j_;
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::shared_ptr <LedgerConsensus> std::shared_ptr <LedgerConsensus>
make_LedgerConsensus (ConsensusImp& consensus, int previousProposers, make_LedgerConsensus (Application& app, ConsensusImp& consensus, int previousProposers,
int previousConvergeTime, InboundTransactions& inboundTransactions, int previousConvergeTime, InboundTransactions& inboundTransactions,
LocalTxs& localtx, LedgerMaster& ledgerMaster, LedgerHash const &prevLCLHash, LocalTxs& localtx, LedgerMaster& ledgerMaster,
Ledger::ref previousLedger, std::uint32_t closeTime, FeeVote& feeVote); LedgerHash const &prevLCLHash, Ledger::ref previousLedger,
std::uint32_t closeTime, FeeVote& feeVote);
} // ripple } // ripple

File diff suppressed because it is too large Load Diff

View File

@@ -43,7 +43,7 @@ int getNextLedgerTimeResolution (
// If we did not previously agree, we try to decrease the resolution to // If we did not previously agree, we try to decrease the resolution to
// improve the chance that we will agree now. // improve the chance that we will agree now.
if (!previousAgree && ((ledgerSeq % decreaseLedgerTimeResolutionEvery) == 0)) if (!previousAgree && ledgerSeq % decreaseLedgerTimeResolutionEvery == 0)
{ {
if (++iter != std::end (ledgerPossibleTimeResolutions)) if (++iter != std::end (ledgerPossibleTimeResolutions))
return *iter; return *iter;
@@ -51,7 +51,7 @@ int getNextLedgerTimeResolution (
// If we previously agreed, we try to increase the resolution to determine // If we previously agreed, we try to increase the resolution to determine
// if we can continue to agree. // if we can continue to agree.
if (previousAgree && ((ledgerSeq % increaseLedgerTimeResolutionEvery) == 0)) if (previousAgree && ledgerSeq % increaseLedgerTimeResolutionEvery == 0)
{ {
if (iter-- != std::begin (ledgerPossibleTimeResolutions)) if (iter-- != std::begin (ledgerPossibleTimeResolutions))
return *iter; return *iter;

View File

@@ -65,14 +65,17 @@ void fillJson(Object& json, LedgerInfo const& info, bool bFull)
json[jss::hash] = to_string (info.hash); json[jss::hash] = to_string (info.hash);
json[jss::totalCoins] = to_string (info.drops); json[jss::totalCoins] = to_string (info.drops);
json[jss::accepted] = ! info.open; json[jss::accepted] = ! info.open;
json[jss::close_flags] = info.closeFlags;
// Always show fields that contribute to the ledger hash
json[jss::parent_close_time] = info.parentCloseTime;
json[jss::close_time] = info.closeTime;
json[jss::close_time_resolution] = info.closeTimeResolution;
if (auto closeTime = info.closeTime) if (auto closeTime = info.closeTime)
{ {
json[jss::close_time] = closeTime;
json[jss::close_time_human] = boost::posix_time::to_simple_string ( json[jss::close_time_human] = boost::posix_time::to_simple_string (
ptFromSeconds (closeTime)); ptFromSeconds (closeTime));
json[jss::close_time_resolution] = info.closeTimeResolution;
if (! getCloseAgree(info)) if (! getCloseAgree(info))
json[jss::close_time_estimated] = true; json[jss::close_time_estimated] = true;
} }
@@ -131,20 +134,20 @@ void fillJsonState(Object& json, LedgerFill const& fill)
auto expanded = isExpanded(fill); auto expanded = isExpanded(fill);
auto binary = isBinary(fill); auto binary = isBinary(fill);
forEachSLE(ledger, [&] (SLE const& sle) { for(auto const& sle : ledger.sles)
{
count.yield(); count.yield();
if (binary) if (binary)
{ {
auto&& obj = appendObject(array); auto&& obj = appendObject(array);
obj[jss::hash] = to_string(sle.key()); obj[jss::hash] = to_string(sle->key());
obj[jss::tx_blob] = serializeHex(sle); obj[jss::tx_blob] = serializeHex(*sle);
} }
else if (expanded) else if (expanded)
array.append(sle.getJson(0)); array.append(sle->getJson(0));
else else
array.append(to_string(sle.key())); array.append(to_string(sle->key()));
return true; }
});
} }
template <class Object> template <class Object>

View File

@@ -20,22 +20,30 @@
#include <BeastConfig.h> #include <BeastConfig.h>
#include <ripple/app/ledger/OpenLedger.h> #include <ripple/app/ledger/OpenLedger.h>
#include <ripple/app/tx/apply.h> #include <ripple/app/tx/apply.h>
#include <ripple/ledger/CachingReadView.h> #include <ripple/ledger/CachedView.h>
#include <boost/range/adaptor/transformed.hpp> #include <boost/range/adaptor/transformed.hpp>
namespace ripple { namespace ripple {
OpenLedger::OpenLedger( OpenLedger::OpenLedger(std::shared_ptr<
std::shared_ptr<Ledger const> const& ledger, Ledger const> const& ledger,
Config const& config, CachedSLEs& cache, Config const& config, CachedSLEs& cache,
beast::Journal journal) beast::Journal journal)
: j_ (journal) : j_ (journal)
, cache_ (cache) , cache_ (cache)
, config_ (config) , config_ (config)
, current_ (create(ledger)) , current_ (create(ledger->rules(), ledger))
{ {
} }
bool
OpenLedger::empty() const
{
std::lock_guard<
std::mutex> lock(modify_mutex_);
return current_->txCount() == 0;
}
std::shared_ptr<ReadView const> std::shared_ptr<ReadView const>
OpenLedger::current() const OpenLedger::current() const
{ {
@@ -65,22 +73,22 @@ OpenLedger::modify (std::function<
} }
void void
OpenLedger::accept (std::shared_ptr< OpenLedger::accept(Application& app, Rules const& rules,
Ledger const> const& ledger, std::shared_ptr<Ledger const> const& ledger,
OrderedTxs const& locals, bool retriesFirst, OrderedTxs const& locals, bool retriesFirst,
OrderedTxs& retries, ApplyFlags flags, OrderedTxs& retries, ApplyFlags flags,
IHashRouter& router, std::string const& suffix) HashRouter& router, std::string const& suffix)
{ {
JLOG(j_.error) << JLOG(j_.trace) <<
"accept ledger " << ledger->seq() << " " << suffix; "accept ledger " << ledger->seq() << " " << suffix;
auto next = create(ledger); auto next = create(rules, ledger);
if (retriesFirst) if (retriesFirst)
{ {
// Handle disputed tx, outside lock // Handle disputed tx, outside lock
using empty = using empty =
std::vector<std::shared_ptr< std::vector<std::shared_ptr<
STTx const>>; STTx const>>;
apply (*next, *ledger, empty{}, apply (app, *next, *ledger, empty{},
retries, flags, router, config_, j_); retries, flags, router, config_, j_);
} }
// Block calls to modify, otherwise // Block calls to modify, otherwise
@@ -90,7 +98,7 @@ OpenLedger::accept (std::shared_ptr<
std::mutex> lock1(modify_mutex_); std::mutex> lock1(modify_mutex_);
// Apply tx from the current open view // Apply tx from the current open view
if (! current_->txs.empty()) if (! current_->txs.empty())
apply (*next, *ledger, apply (app, *next, *ledger,
boost::adaptors::transform( boost::adaptors::transform(
current_->txs, current_->txs,
[](std::pair<std::shared_ptr< [](std::pair<std::shared_ptr<
@@ -102,8 +110,9 @@ OpenLedger::accept (std::shared_ptr<
retries, flags, router, config_, j_); retries, flags, router, config_, j_);
// Apply local tx // Apply local tx
for (auto const& item : locals) for (auto const& item : locals)
ripple::apply(*next, *item.second, ripple::apply(app, *next, *item.second,
flags, config_, j_); flags, router.sigVerify(),
config_, j_);
// Switch to the new open view // Switch to the new open view
std::lock_guard< std::lock_guard<
std::mutex> lock2(current_mutex_); std::mutex> lock2(current_mutex_);
@@ -113,20 +122,20 @@ OpenLedger::accept (std::shared_ptr<
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::shared_ptr<OpenView> std::shared_ptr<OpenView>
OpenLedger::create (std::shared_ptr< OpenLedger::create (Rules const& rules,
Ledger const> const& ledger) std::shared_ptr<Ledger const> const& ledger)
{ {
return std::make_shared<OpenView>( return std::make_shared<OpenView>(
open_ledger, std::make_shared< open_ledger, rules, std::make_shared<
CachingReadView const>(ledger, CachedLedger const>(ledger,
cache_)); cache_));
} }
auto auto
OpenLedger::apply_one (OpenView& view, OpenLedger::apply_one (Application& app, OpenView& view,
std::shared_ptr<STTx const> const& tx, std::shared_ptr<STTx const> const& tx,
bool retry, ApplyFlags flags, bool retry, ApplyFlags flags,
IHashRouter& router, Config const& config, HashRouter& router, Config const& config,
beast::Journal j) -> Result beast::Journal j) -> Result
{ {
if (retry) if (retry)
@@ -136,7 +145,8 @@ OpenLedger::apply_one (OpenView& view,
SF_SIGGOOD) SF_SIGGOOD)
flags = flags | tapNO_CHECK_SIGN; flags = flags | tapNO_CHECK_SIGN;
auto const result = ripple::apply( auto const result = ripple::apply(
view, *tx, flags, config, j); app, view, *tx, flags, router.
sigVerify(), config, j);
if (result.second) if (result.second)
return Result::success; return Result::success;
if (isTefFailure (result.first) || if (isTefFailure (result.first) ||
@@ -148,40 +158,6 @@ OpenLedger::apply_one (OpenView& view,
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
static
std::vector<uint256>
txList (ReadView const& view)
{
std::vector<uint256> v;
for (auto const& item : view.txs)
v.push_back(item.first->getTransactionID());
std::sort(v.begin(), v.end());
return v;
}
bool
OpenLedger::verify (Ledger const& ledger,
std::string const& suffix) const
{
#if 1
std::lock_guard<
std::mutex> lock(modify_mutex_);
auto list1 = txList(ledger);
auto list2 = txList(*current_);
if (list1 == list2)
return true;
JLOG(j_.error) <<
"verify ledger " << ledger.seq() << ": " <<
list1.size() << " / " << list2.size() <<
" " << " MISMATCH " << suffix;
return false;
#else
return true;
#endif
}
//------------------------------------------------------------------------------
std::string std::string
debugTxstr (std::shared_ptr<STTx const> const& tx) debugTxstr (std::shared_ptr<STTx const> const& tx)
{ {

View File

@@ -1,152 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#include <ripple/app/ledger/tests/common_ledger.h>
namespace ripple {
namespace test {
#if 0
class Ledger_test : public beast::unit_test::suite
{
void test_genesisLedger (bool sign, KeyType keyType)
{
std::uint64_t const xrp = std::mega::num;
auto master = createAccount ("masterpassphrase", keyType);
std::shared_ptr<Ledger const> LCL;
Ledger::pointer ledger;
std::tie(LCL, ledger) = createGenesisLedger(100000*xrp, master);
// User accounts
auto gw1 = createAccount ("gw1", keyType);
expect (gw1.pk != master.pk, "gw1.pk != master.pk");
expect (gw1.sk != master.sk, "gw1.sk != master.sk");
auto gw2 = createAccount ("gw2", keyType);
auto gw3 = createAccount ("gw3", keyType);
auto alice = createAccount ("alice", keyType);
auto mark = createAccount ("mark", keyType);
// Fund gw1, gw2, gw3, alice, mark from master
pay(master, gw1, 5000 * xrp, ledger, sign);
pay(master, gw2, 4000 * xrp, ledger, sign);
pay(master, gw3, 3000 * xrp, ledger, sign);
pay(master, alice, 2000 * xrp, ledger, sign);
pay(master, mark, 1000 * xrp, ledger, sign);
close_and_advance(ledger, LCL);
// alice trusts FOO/gw1
trust (alice, gw1, "FOO", 1, ledger, sign);
// mark trusts FOO/gw2
trust (mark, gw2, "FOO", 1, ledger, sign);
// mark trusts FOO/gw3
trust (mark, gw3, "FOO", 1, ledger, sign);
// gw2 pays mark with FOO
pay(gw2, mark, "FOO", "0.1", ledger, sign);
// gw3 pays mark with FOO
pay(gw3, mark, "FOO", "0.2", ledger, sign);
// gw1 pays alice with FOO
pay(gw1, alice, "FOO", "0.3", ledger, sign);
verifyBalance(ledger, mark, Amount(0.1, "FOO", gw2));
verifyBalance(ledger, mark, Amount(0.2, "FOO", gw3));
verifyBalance(ledger, alice, Amount(0.3, "FOO", gw1));
close_and_advance(ledger, LCL);
createOffer (mark, Amount (1, "FOO", gw1), Amount (1, "FOO", gw2), ledger, sign);
createOffer (mark, Amount (1, "FOO", gw2), Amount (1, "FOO", gw3), ledger, sign);
cancelOffer (mark, ledger, sign);
freezeAccount (alice, ledger, sign);
close_and_advance(ledger, LCL);
pay(alice, mark, 1 * xrp, ledger, sign);
close_and_advance(ledger, LCL);
pass ();
}
void test_unsigned_fails (KeyType keyType)
{
std::uint64_t const xrp = std::mega::num;
auto master = createAccount ("masterpassphrase", keyType);
std::shared_ptr<Ledger const> LCL;
Ledger::pointer ledger;
std::tie(LCL, ledger) = createGenesisLedger (100000 * xrp, master);
auto gw1 = createAccount ("gw1", keyType);
auto tx = getPaymentTx(master, gw1, 5000 * xrp, false);
try
{
applyTransaction (ledger, tx, true);
fail ("apply unsigned transaction should fail");
}
catch (std::runtime_error const& e)
{
if (std::string (e.what()) != "r != tesSUCCESS")
throw std::runtime_error(e.what());
}
pass ();
}
void test_getQuality ()
{
uint256 uBig = from_hex_text<uint256> (
"D2DC44E5DC189318DB36EF87D2104CDF0A0FE3A4B698BEEE55038D7EA4C68000");
expect (6125895493223874560 == getQuality (uBig));
pass ();
}
public:
void run ()
{
test_genesisLedger (true, KeyType::secp256k1);
test_genesisLedger (true, KeyType::ed25519);
// test_genesisLedger (false, KeyType::secp256k1);
// test_genesisLedger (false, KeyType::ed25519);
test_unsigned_fails (KeyType::secp256k1);
test_unsigned_fails (KeyType::ed25519);
test_getQuality ();
}
};
BEAST_DEFINE_TESTSUITE(Ledger,ripple_app,ripple);
#endif
} // test
} // ripple

View File

@@ -1,569 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012-2015 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#include <ripple/app/ledger/tests/common_ledger.h>
#include <ripple/app/main/Application.h>
#include <ripple/app/paths/FindPaths.h>
#include <ripple/app/tx/apply.h>
#include <ripple/protocol/RippleAddress.h>
#include <ripple/protocol/Indexes.h>
#include <ripple/protocol/types.h>
#include <ripple/rpc/RipplePathFind.h>
#include <ripple/json/json_writer.h>
#if 0
namespace ripple {
namespace test {
Json::Value
TestJson::getJson() const
{
Json::Value tx_json;
getJson(tx_json);
return tx_json;
}
Currency::Currency(std::string currency)
: currency_(currency)
{
}
void
Currency::getJson(Json::Value& tx_json) const
{
tx_json[jss::currency] = currency_;
}
std::string
Currency::getCurrency() const
{
return currency_;
}
Issuer::Issuer(TestAccount issuer)
:issuer_(issuer)
{
}
void
Issuer::getJson(Json::Value& tx_json) const
{
tx_json[jss::issuer] = toBase58(calcAccountID(issuer_.pk));
}
TestAccount const&
Issuer::getAccount() const
{
return issuer_;
}
Amount::Amount(double value, std::string currency, TestAccount issuer)
: value_(value)
, currency_(Currency(currency))
, issuer_(Issuer(issuer))
{
}
void
Amount::getJson(Json::Value& tx_json) const
{
currency_.getJson(tx_json);
issuer_.getJson(tx_json);
tx_json[jss::value] = std::to_string(value_);
}
double
Amount::getValue() const
{
return value_;
}
TestAccount const&
Amount::getIssuer() const
{
return issuer_.getAccount();
}
Currency const&
Amount::getCurrency() const
{
return currency_;
}
// Helper function to parse a transaction in Json, sign it with account,
// and return it as a STTx
STTx
parseTransaction(TestAccount& account, Json::Value const& tx_json, bool sign)
{
STParsedJSONObject parsed("tx_json", tx_json);
if (!parsed.object)
throw std::runtime_error(
"object not parseable");
parsed.object->setFieldVL(sfSigningPubKey, account.pk.getAccountPublic());
auto tx = STTx(std::move (*parsed.object));
if (sign)
tx.sign(account.sk);
return tx;
}
// Helper function to apply a transaction to a ledger
void
applyTransaction(Ledger::pointer const& ledger, STTx const& tx, bool check)
{
auto const r = apply (*ledger, tx,
check ? tapNONE : tapNO_CHECK_SIGN, getConfig(),
beast::Journal{});
if (r.first != tesSUCCESS)
throw std::runtime_error("r != tesSUCCESS");
if (!r.second)
throw std::runtime_error("didApply");
}
// Create genesis ledger from a start amount in drops, and the public
// master RippleAddress
std::pair<std::shared_ptr<Ledger const>, Ledger::pointer>
createGenesisLedger(std::uint64_t start_amount_drops, TestAccount const& master)
{
initializePathfinding();
auto ledger = std::make_shared<Ledger>(master.pk,
start_amount_drops);
ledger->getHash(); // updates the hash
ledger->setClosed();
if (!ledger->assertSane())
throw std::runtime_error(
"! ledger->assertSane()");
return std::make_pair(std::move(ledger), std::make_shared<Ledger>(false, *ledger));
}
// Create an account represented by public RippleAddress and private
// RippleAddress
TestAccount
createAccount(std::string const& passphrase, KeyType keyType)
{
RippleAddress const seed
= RippleAddress::createSeedGeneric(passphrase);
auto keyPair = generateKeysFromSeed(keyType, seed);
return {
std::move(keyPair.publicKey),
std::move(keyPair.secretKey),
std::uint64_t(0)
};
}
TestAccount
createAndFundAccount(TestAccount& from, std::string const& passphrase,
KeyType keyType, std::uint64_t amountDrops,
Ledger::pointer const& ledger, bool sign)
{
auto to = createAccount(passphrase, keyType);
pay(from, to, amountDrops, ledger, sign);
return to;
}
std::map<std::string, TestAccount>
createAndFundAccounts(TestAccount& from, std::vector<std::string> passphrases,
KeyType keyType, std::uint64_t amountDrops,
Ledger::pointer const& ledger, bool sign)
{
std::map<std::string, TestAccount> accounts;
for (auto const& passphrase : passphrases)
{
auto to = createAndFundAccount(from, passphrase, keyType,
amountDrops, ledger, sign);
accounts.emplace(passphrase, std::move(to));
}
return accounts;
}
std::map<std::string, TestAccount>
createAndFundAccountsWithFlags(TestAccount& from,
std::vector<std::string> passphrases,
KeyType keyType, std::uint64_t amountDrops,
Ledger::pointer& ledger,
std::shared_ptr<Ledger const>& LCL,
const std::uint32_t flags, bool sign)
{
auto accounts = createAndFundAccounts(from,
passphrases, keyType, amountDrops, ledger, sign);
close_and_advance(ledger, LCL);
setAllAccountFlags(accounts, ledger, flags);
close_and_advance(ledger, LCL);
return accounts;
}
Json::Value
getCommonTransactionJson(TestAccount& account)
{
Json::Value tx_json;
tx_json[jss::Account] = toBase58(calcAccountID(account.pk));
tx_json[jss::Fee] = std::to_string(10);
tx_json[jss::Sequence] = ++account.sequence;
return tx_json;
}
void
setAccountFlags(TestAccount& account, Ledger::pointer const& ledger,
const std::uint32_t flags, bool sign)
{
Json::Value tx_json = getCommonTransactionJson(account);
tx_json[jss::TransactionType] = "AccountSet";
tx_json[jss::SetFlag] = flags;
STTx tx = parseTransaction(account, tx_json, sign);
applyTransaction(ledger, tx, sign);
}
void
setAllAccountFlags(std::vector<TestAccount>& accounts, Ledger::pointer const& ledger,
const std::uint32_t flags, bool sign)
{
for (auto& account : accounts)
{
setAccountFlags(account, ledger, flags, sign);
}
}
void
clearAccountFlags(TestAccount& account, Ledger::pointer const& ledger,
const std::uint32_t flags, bool sign)
{
Json::Value tx_json = getCommonTransactionJson(account);
tx_json[jss::TransactionType] = "AccountSet";
tx_json[jss::ClearFlag] = flags;
STTx tx = parseTransaction(account, tx_json, sign);
applyTransaction(ledger, tx, sign);
}
void
freezeAccount(TestAccount& account, Ledger::pointer const& ledger, bool sign)
{
setAccountFlags(account, ledger, asfGlobalFreeze, sign);
}
void
unfreezeAccount(TestAccount& account, Ledger::pointer const& ledger, bool sign)
{
clearAccountFlags(account, ledger, asfGlobalFreeze, sign);
}
Json::Value
getPaymentJson(TestAccount& from, TestAccount const& to,
Json::Value amountJson)
{
Json::Value tx_json = getCommonTransactionJson(from);
tx_json[jss::Amount] = amountJson;
tx_json[jss::Destination] = toBase58(calcAccountID(to.pk));
tx_json[jss::TransactionType] = "Payment";
tx_json[jss::Flags] = tfUniversal;
return tx_json;
}
STTx
getPaymentTx(TestAccount& from, TestAccount const& to,
std::uint64_t amountDrops,
bool sign)
{
Json::Value tx_json = getPaymentJson(from, to,
std::to_string(amountDrops));
return parseTransaction(from, tx_json, sign);
}
STTx
pay(TestAccount& from, TestAccount const& to,
std::uint64_t amountDrops,
Ledger::pointer const& ledger, bool sign)
{
auto tx = getPaymentTx(from, to, amountDrops, sign);
applyTransaction(ledger, tx, sign);
return tx;
}
STTx
getPaymentTx(TestAccount& from, TestAccount const& to,
std::string const& currency, std::string const& amount,
bool sign)
{
Json::Value tx_json = getPaymentJson(from, to,
Amount(std::stod(amount), currency, to).getJson());
return parseTransaction(from, tx_json, sign);
}
STTx
pay(TestAccount& from, TestAccount const& to,
std::string const& currency, std::string const& amount,
Ledger::pointer const& ledger, bool sign)
{
auto tx = getPaymentTx(from, to, currency, amount, sign);
applyTransaction(ledger, tx, sign);
return tx;
}
STTx
getPaymentTxWithPath(TestAccount& from, TestAccount const& to,
std::string const& currency, std::string const& amount,
Ledger::pointer const& ledger, bool sign)
{
auto amountJson = Amount(std::stod(amount), currency, to).getJson();
Json::Value tx_json = getPaymentJson(from, to, amountJson);
// Find path. Note that the sign command can do this transparently
// with the "build_path" field, but we don't have that here.
auto cache = std::make_shared<RippleLineCache>(ledger);
STPathSet pathSet;
STPath fullLiquidityPath;
auto stDstAmount = amountFromJson(sfGeneric, amountJson);
Issue srcIssue = Issue(stDstAmount.getCurrency(),
calcAccountID(from.pk));
auto found = findPathsForOneIssuer(cache,
calcAccountID(from.pk), calcAccountID(to.pk),
srcIssue, stDstAmount, 7, 4, pathSet, fullLiquidityPath);
if (!found)
throw std::runtime_error(
"!found");
if (pathSet.isDefault())
throw std::runtime_error(
"pathSet.isDefault()");
tx_json[jss::Paths] = pathSet.getJson(0);
return parseTransaction(from, tx_json, sign);
}
STTx
payWithPath(TestAccount& from, TestAccount const& to,
std::string const& currency, std::string const& amount,
Ledger::pointer const& ledger, bool sign)
{
auto tx = getPaymentTxWithPath(from, to, currency, amount, ledger, sign);
applyTransaction(ledger, tx, sign);
return tx;
}
STTx
payWithPath(TestAccount& from, TestAccount const& to,
std::string const& currency, std::string const& amount,
Ledger::pointer const& ledger, Json::Value const& path,
std::uint32_t flags, bool sign)
{
auto amountJson = Amount(std::stod(amount), currency, to).getJson();
Json::Value tx_json = getPaymentJson(from, to, amountJson);
tx_json[jss::Paths] = path;
tx_json[jss::Flags] = flags;
auto tx = parseTransaction(from, tx_json, sign);
applyTransaction(ledger, tx, sign);
return tx;
}
void
createOffer(TestAccount& from, Amount const& in, Amount const& out,
Ledger::pointer ledger, bool sign)
{
Json::Value tx_json = getCommonTransactionJson(from);
tx_json[jss::TransactionType] = "OfferCreate";
tx_json[jss::TakerPays] = in.getJson();
tx_json[jss::TakerGets] = out.getJson();
STTx tx = parseTransaction(from, tx_json, sign);
applyTransaction(ledger, tx, sign);
}
void
createOfferWithFlags(TestAccount& from, Amount const& in, Amount const& out,
Ledger::pointer ledger, std::uint32_t flags,
bool sign)
{
Json::Value tx_json = getCommonTransactionJson(from);
tx_json[jss::TransactionType] = "OfferCreate";
tx_json[jss::TakerPays] = in.getJson();
tx_json[jss::TakerGets] = out.getJson();
tx_json[jss::Flags] = flags;
STTx tx = parseTransaction(from, tx_json, sign);
applyTransaction(ledger, tx, sign);
}
// As currently implemented, this will cancel only the last offer made
// from this account.
void
cancelOffer(TestAccount& from, Ledger::pointer ledger, bool sign)
{
auto seq = from.sequence;
Json::Value tx_json = getCommonTransactionJson(from);
tx_json[jss::TransactionType] = "OfferCancel";
tx_json[jss::OfferSequence] = seq;
STTx tx = parseTransaction(from, tx_json, sign);
applyTransaction(ledger, tx, sign);
}
void
trust(TestAccount& from, TestAccount const& issuer,
std::string const& currency, double amount,
Ledger::pointer const& ledger, bool sign)
{
Json::Value tx_json = getCommonTransactionJson(from);
Json::Value& limitAmount = tx_json[jss::LimitAmount];
limitAmount[jss::currency] = currency;
limitAmount[jss::issuer] = toBase58(calcAccountID(issuer.pk));
limitAmount[jss::value] = std::to_string(amount);
tx_json[jss::TransactionType] = "TrustSet";
tx_json[jss::Flags] = 0; // tfClearNoRipple;
STTx tx = parseTransaction(from, tx_json, sign);
applyTransaction(ledger, tx, sign);
}
void
close_and_advance(Ledger::pointer& ledger, std::shared_ptr<Ledger const>& LCL)
{
auto const& set = ledger->txMap();
CanonicalTXSet retriableTransactions(set.getHash());
// Make a non-const copy of LCL. This won't be necessary once
// that other Ledger constructor can take a const Ledger.
Ledger oldLCL(*LCL, false);
Ledger::pointer newLCL = std::make_shared<Ledger>(false, oldLCL);
MetaView accum(*newLCL, tapNONE);
// Set up to write SHAMap changes to our database,
// perform updates, extract changes
applyTransactions(&set, accum, newLCL, retriableTransactions);
accum.apply(*newLCL, {});
newLCL->updateSkipList();
newLCL->setClosed();
newLCL->stateMap().flushDirty(
hotACCOUNT_NODE, newLCL->info().seq);
newLCL->txMap().flushDirty(
hotTRANSACTION_NODE, newLCL->info().seq);
using namespace std::chrono;
auto const epoch_offset = days(10957); // 2000-01-01
std::uint32_t closeTime = time_point_cast<seconds> // now
(system_clock::now() - epoch_offset).
time_since_epoch().count();
int closeResolution = seconds(ledgerDefaultTimeResolution).count();
bool closeTimeCorrect = true;
newLCL->setAccepted(closeTime, closeResolution, closeTimeCorrect);
if (!newLCL->assertSane())
throw std::runtime_error(
"!newLCL->assertSane()");
LCL = newLCL;
ledger = std::make_shared<Ledger>(false, *newLCL);
}
Json::Value findPath(Ledger::pointer ledger, TestAccount const& src,
TestAccount const& dest, std::vector<Currency> srcCurrencies,
Amount const& dstAmount, beast::abstract_ostream& log,
boost::optional<Json::Value> contextPaths)
{
int const level = 8;
auto cache = std::make_shared<RippleLineCache>(ledger);
STAmount saDstAmount;
if (!amountFromJsonNoThrow(saDstAmount, dstAmount.getJson()))
throw std::runtime_error(
"!amountFromJsonNoThrow(saDstAmount, dstAmount.getJson())");
log << "Dst amount: " << saDstAmount;
auto jvSrcCurrencies = Json::Value(Json::arrayValue);
for (auto const& srcCurrency : srcCurrencies)
{
jvSrcCurrencies.append(srcCurrency.getJson());
}
log << "Source currencies: " << jvSrcCurrencies;
auto result = ripplePathFind(cache, calcAccountID(src.pk),
calcAccountID(dest.pk), saDstAmount,
jvSrcCurrencies, contextPaths, level);
if(!result.first)
throw std::runtime_error(
"ripplePathFind find failed");
return result.second;
}
std::shared_ptr<SLE const>
getLedgerEntryRippleState(Ledger::pointer ledger,
TestAccount const& account1, TestAccount const& account2,
Currency currency)
{
auto k = keylet::line(
calcAccountID(account1.pk), calcAccountID(account2.pk),
to_currency(currency.getCurrency()));
if (! k.key.isNonZero())
throw std::runtime_error(
"!k.key.isNonZero()");
return ledger->read(k);
}
void
verifyBalance(Ledger::pointer ledger, TestAccount const& account,
Amount const& amount)
{
auto const sle = getLedgerEntryRippleState(ledger, account,
amount.getIssuer(), amount.getCurrency());
if (!sle)
throw std::runtime_error(
"!sle");
STAmount amountReq;
amountFromJsonNoThrow(amountReq, amount.getJson());
auto high = sle->getFieldAmount(sfHighLimit);
auto balance = sle->getFieldAmount(sfBalance);
if (high.getIssuer() == calcAccountID(account.pk))
{
balance.negate();
}
if (balance != amountReq)
throw std::runtime_error(
"balance != amountReq");
}
Json::Value pathNode (TestAccount const& acc)
{
Json::Value result;
result["account"] = toBase58(calcAccountID(acc.pk));
result["type"] = 1;
result["type_hex"] = "0000000000000001";
return result;
}
Json::Value pathNode (OfferPathNode const& offer)
{
Json::Value result;
result["currency"] = offer.currency;
result["type"] = 48;
result["type_hex"] = "0000000000000030";
if (offer.issuer)
result["issuer"] = toBase58(calcAccountID(offer.issuer->pk));
return result;
}
}
}
#endif

View File

@@ -1,294 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_APP_TESTS_COMMON_LEDGER_H_INCLUDED
#define RIPPLE_APP_TESTS_COMMON_LEDGER_H_INCLUDED
#include <ripple/app/ledger/Ledger.h>
#include <ripple/app/ledger/LedgerConsensus.h>
#include <ripple/app/ledger/LedgerTiming.h>
#include <ripple/app/misc/CanonicalTXSet.h>
#include <ripple/app/tx/impl/Transactor.h>
#include <ripple/basics/chrono.h>
#include <ripple/crypto/KeyType.h>
#include <ripple/json/json_value.h>
#include <ripple/protocol/JsonFields.h>
#include <ripple/protocol/Indexes.h>
#include <ripple/protocol/RippleAddress.h>
#include <ripple/protocol/STParsedJSON.h>
#include <ripple/protocol/TxFlags.h>
#include <ripple/protocol/STLedgerEntry.h>
#include <beast/unit_test/suite.h>
#include <beast/streams/abstract_ostream.h>
#include <chrono>
#include <string>
namespace ripple {
namespace test {
struct TestAccount
{
RippleAddress pk;
RippleAddress sk;
unsigned sequence;
};
struct TestJson
{
Json::Value
getJson() const;
virtual void
getJson(Json::Value& tx_json) const = 0;
};
struct Currency : TestJson
{
Currency(std::string currency);
void
getJson(Json::Value& tx_json) const override;
std::string
getCurrency() const;
using TestJson::getJson;
private:
std::string currency_;
};
struct Issuer : TestJson
{
Issuer(TestAccount issuer);
void
getJson(Json::Value& tx_json) const override;
TestAccount const&
getAccount() const;
using TestJson::getJson;
private:
TestAccount issuer_;
};
struct Amount : TestJson
{
Amount(double value, std::string currency, TestAccount issuer);
void
getJson(Json::Value& tx_json) const override;
double
getValue() const;
TestAccount const&
getIssuer() const;
Currency const&
getCurrency() const;
using TestJson::getJson;
private:
double value_;
Currency currency_;
Issuer issuer_;
};
// Helper function to parse a transaction in Json, sign it with account,
// and return it as a STTx
STTx
parseTransaction(TestAccount& account, Json::Value const& tx_json, bool sign = true);
// Helper function to apply a transaction to a ledger
void
applyTransaction(Ledger::pointer const& ledger, STTx const& tx, bool check = true);
// Create genesis ledger from a start amount in drops, and the public
// master RippleAddress
std::pair<std::shared_ptr<Ledger const>, Ledger::pointer>
createGenesisLedger(std::uint64_t start_amount_drops, TestAccount const& master);
// Create an account represented by public RippleAddress and private
// RippleAddress
TestAccount
createAccount(std::string const& passphrase, KeyType keyType);
TestAccount
createAndFundAccount(TestAccount& from, std::string const& passphrase,
KeyType keyType, std::uint64_t amountDrops,
Ledger::pointer const& ledger, bool sign = true);
std::map<std::string, TestAccount>
createAndFundAccounts(TestAccount& from, std::vector<std::string> passphrases,
KeyType keyType, std::uint64_t amountDrops,
Ledger::pointer const& ledger, bool sign = true);
std::map<std::string, TestAccount>
createAndFundAccountsWithFlags(TestAccount& from,
std::vector<std::string> passphrases,
KeyType keyType, std::uint64_t amountDrops,
Ledger::pointer& ledger,
std::shared_ptr<Ledger const>& LCL,
const std::uint32_t flags, bool sign = true);
void
setAccountFlags(TestAccount& account, Ledger::pointer const& ledger,
const std::uint32_t flags, bool sign = true);
void
setAllAccountFlags(std::vector<TestAccount>& accounts, Ledger::pointer const& ledger,
const std::uint32_t flags, bool sign = true);
template<class key_t>
void
setAllAccountFlags(std::map<key_t, TestAccount>& accounts, Ledger::pointer const& ledger,
const std::uint32_t flags, bool sign = true)
{
for (auto& pair : accounts)
{
setAccountFlags(pair.second, ledger, flags, sign);
}
}
void
clearAccountFlags(TestAccount& account, Ledger::pointer const& ledger,
const std::uint32_t flags, bool sign = true);
void
freezeAccount(TestAccount& account, Ledger::pointer const& ledger, bool sign = true);
void
unfreezeAccount(TestAccount& account, Ledger::pointer const& ledger, bool sign = true);
STTx
getPaymentTx(TestAccount& from, TestAccount const& to,
std::uint64_t amountDrops,
bool sign = true);
STTx
pay(TestAccount& from, TestAccount const& to,
std::uint64_t amountDrops,
Ledger::pointer const& ledger, bool sign = true);
STTx
getPaymentTx(TestAccount& from, TestAccount const& to,
std::string const& currency, std::string const& amount,
bool sign = true);
STTx
pay(TestAccount& from, TestAccount const& to,
std::string const& currency, std::string const& amount,
Ledger::pointer const& ledger, bool sign = true);
STTx
getPaymentTxWithPath(TestAccount& from, TestAccount const& to,
std::string const& currency, std::string const& amount,
Ledger::pointer const& ledger, bool sign = true);
STTx
payWithPath(TestAccount& from, TestAccount const& to,
std::string const& currency, std::string const& amount,
Ledger::pointer const& ledger, bool sign = true);
STTx
payWithPath(TestAccount& from, TestAccount const& to,
std::string const& currency, std::string const& amount,
Ledger::pointer const& ledger, Json::Value const& path,
std::uint32_t flags,
bool sign = true);
void
createOffer(TestAccount& from, Amount const& in, Amount const& out,
Ledger::pointer ledger, bool sign = true);
void
createOfferWithFlags(TestAccount& from, Amount const& in, Amount const& out,
Ledger::pointer ledger, std::uint32_t flags,
bool sign = true);
// As currently implemented, this will cancel only the last offer made
// from this account.
void
cancelOffer(TestAccount& from, Ledger::pointer ledger, bool sign = true);
void
trust(TestAccount& from, TestAccount const& issuer,
std::string const& currency, double amount,
Ledger::pointer const& ledger, bool sign = true);
void
close_and_advance(Ledger::pointer& ledger, std::shared_ptr<Ledger const>& LCL);
Json::Value findPath(Ledger::pointer ledger, TestAccount const& src,
TestAccount const& dest, std::vector<Currency> srcCurrencies,
Amount const& dstAmount, beast::abstract_ostream& log,
boost::optional<Json::Value> contextPaths = boost::none);
struct OfferPathNode
{
std::string currency;
boost::optional<TestAccount> issuer;
OfferPathNode(std::string s, TestAccount const& iss)
:currency(std::move(s)), issuer(iss) {}
};
Json::Value pathNode (TestAccount const& acc);
Json::Value pathNode (OfferPathNode const& offer);
inline void createPathHelper (Json::Value& result)
{
// base case
}
template<class First, class... Rest>
void createPathHelper (Json::Value& result,
First&& first,
Rest&&... rest)
{
result.append (pathNode (std::forward<First> (first)));
createPathHelper(result, rest...);
}
template<class First, class... Rest>
Json::Value createPath (First&& first,
Rest&&... rest)
{
Json::Value result;
createPathHelper (result, first, rest...);
return result;
}
SLE::pointer
get_ledger_entry_ripple_state(Ledger::pointer ledger,
RippleAddress account1, RippleAddress account2,
Currency currency);
void
verifyBalance(Ledger::pointer ledger, TestAccount const& account, Amount const& amount);
} // test
} // ripple
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -23,6 +23,7 @@
#include <ripple/shamap/FullBelowCache.h> #include <ripple/shamap/FullBelowCache.h>
#include <ripple/shamap/TreeNodeCache.h> #include <ripple/shamap/TreeNodeCache.h>
#include <ripple/basics/TaggedCache.h> #include <ripple/basics/TaggedCache.h>
#include <ripple/core/Config.h>
#include <beast/utility/PropertyStream.h> #include <beast/utility/PropertyStream.h>
#include <beast/cxx14/memory.h> // <memory> #include <beast/cxx14/memory.h> // <memory>
#include <mutex> #include <mutex>
@@ -31,7 +32,7 @@ namespace boost { namespace asio { class io_service; } }
namespace ripple { namespace ripple {
namespace Validators { class Manager; } namespace unl { class Manager; }
namespace Resource { class Manager; } namespace Resource { class Manager; }
namespace NodeStore { class Database; } namespace NodeStore { class Database; }
@@ -39,10 +40,8 @@ namespace NodeStore { class Database; }
class AmendmentTable; class AmendmentTable;
class CachedSLEs; class CachedSLEs;
class CollectorManager; class CollectorManager;
namespace shamap {
class Family; class Family;
} // shamap class HashRouter;
class IHashRouter;
class Logs; class Logs;
class LoadFeeTrack; class LoadFeeTrack;
class LocalCredentials; class LocalCredentials;
@@ -50,6 +49,7 @@ class UniqueNodeList;
class JobQueue; class JobQueue;
class InboundLedgers; class InboundLedgers;
class InboundTransactions; class InboundTransactions;
class AcceptedLedger;
class LedgerMaster; class LedgerMaster;
class LoadManager; class LoadManager;
class NetworkOPs; class NetworkOPs;
@@ -60,6 +60,7 @@ class PathRequests;
class PendingSaves; class PendingSaves;
class AccountIDCache; class AccountIDCache;
class STLedgerEntry; class STLedgerEntry;
class TimeKeeper;
class TransactionMaster; class TransactionMaster;
class Validations; class Validations;
@@ -89,16 +90,17 @@ public:
Application (); Application ();
virtual ~Application () = default; virtual ~Application () = default;
virtual Config const& config() const = 0;
virtual Logs& logs() = 0;
virtual boost::asio::io_service& getIOService () = 0; virtual boost::asio::io_service& getIOService () = 0;
virtual CollectorManager& getCollectorManager () = 0; virtual CollectorManager& getCollectorManager () = 0;
virtual shamap::Family& family() = 0; virtual Family& family() = 0;
virtual TimeKeeper& timeKeeper() = 0;
virtual JobQueue& getJobQueue () = 0; virtual JobQueue& getJobQueue () = 0;
virtual NodeCache& getTempNodeCache () = 0; virtual NodeCache& getTempNodeCache () = 0;
virtual CachedSLEs& cachedSLEs() = 0; virtual CachedSLEs& cachedSLEs() = 0;
virtual Validators::Manager& getValidators () = 0;
virtual AmendmentTable& getAmendmentTable() = 0; virtual AmendmentTable& getAmendmentTable() = 0;
virtual IHashRouter& getHashRouter () = 0; virtual HashRouter& getHashRouter () = 0;
virtual LoadFeeTrack& getFeeTrack () = 0; virtual LoadFeeTrack& getFeeTrack () = 0;
virtual LoadManager& getLoadManager () = 0; virtual LoadManager& getLoadManager () = 0;
virtual Overlay& overlay () = 0; virtual Overlay& overlay () = 0;
@@ -107,6 +109,8 @@ public:
virtual NodeStore::Database& getNodeStore () = 0; virtual NodeStore::Database& getNodeStore () = 0;
virtual InboundLedgers& getInboundLedgers () = 0; virtual InboundLedgers& getInboundLedgers () = 0;
virtual InboundTransactions& getInboundTransactions () = 0; virtual InboundTransactions& getInboundTransactions () = 0;
virtual TaggedCache <uint256, AcceptedLedger>&
getAcceptedLedgerCache () = 0;
virtual LedgerMaster& getLedgerMaster () = 0; virtual LedgerMaster& getLedgerMaster () = 0;
virtual NetworkOPs& getOPs () = 0; virtual NetworkOPs& getOPs () = 0;
virtual OrderBookDB& getOrderBookDB () = 0; virtual OrderBookDB& getOrderBookDB () = 0;
@@ -123,6 +127,9 @@ public:
virtual std::chrono::milliseconds getIOLatency () = 0; virtual std::chrono::milliseconds getIOLatency () = 0;
virtual bool serverOkay (std::string& reason) = 0;
virtual beast::Journal journal (std::string const& name) = 0;
/** Retrieve the "wallet database" /** Retrieve the "wallet database"
It looks like this is used to store the unique node list. It looks like this is used to store the unique node list.
@@ -132,7 +139,6 @@ public:
// //
virtual DatabaseCon& getWalletDB () = 0; virtual DatabaseCon& getWalletDB () = 0;
virtual bool getSystemTimeOffset (int& offset) = 0;
virtual bool isShutdown () = 0; virtual bool isShutdown () = 0;
virtual bool running () = 0; virtual bool running () = 0;
virtual void setup () = 0; virtual void setup () = 0;
@@ -140,27 +146,12 @@ public:
virtual void signalStop () = 0; virtual void signalStop () = 0;
}; };
/** Create an instance of the Application object.
As long as there are legacy calls to getApp it is not safe
to create more than one Application object at a time.
*/
std::unique_ptr <Application> std::unique_ptr <Application>
make_Application(Logs& logs); make_Application(
std::unique_ptr<Config const> config,
std::unique_ptr<Logs> logs);
// VFALCO DEPRECATED // DEPRECATED
//
// Please do not write new code that calls getApp(). Instead,
// Use dependency injection to construct your class with a
// reference to the desired interface (Application in this case).
// Or better yet, instead of relying on the entire Application
// object, construct with just the interfaces that you need.
//
// When working in existing code, try to clean it up by rewriting
// calls to getApp to use a data member instead, and inject the
// needed interfaces in the constructor.
//
// http://en.wikipedia.org/wiki/Dependency_injection
//
extern Application& getApp (); extern Application& getApp ();
} }

View File

@@ -23,7 +23,7 @@
BasicApp::BasicApp(std::size_t numberOfThreads) BasicApp::BasicApp(std::size_t numberOfThreads)
{ {
work_ = boost::in_place(std::ref(io_service_)); work_.emplace (io_service_);
threads_.reserve(numberOfThreads); threads_.reserve(numberOfThreads);
while(numberOfThreads--) while(numberOfThreads--)
threads_.emplace_back( threads_.emplace_back(

View File

@@ -19,6 +19,7 @@
#include <BeastConfig.h> #include <BeastConfig.h>
#include <ripple/app/main/CollectorManager.h> #include <ripple/app/main/CollectorManager.h>
#include <beast/cxx14/memory.h>
namespace ripple { namespace ripple {
@@ -56,12 +57,12 @@ public:
{ {
} }
beast::insight::Collector::ptr const& collector () beast::insight::Collector::ptr const& collector () override
{ {
return m_collector; return m_collector;
} }
beast::insight::Group::ptr const& group (std::string const& name) beast::insight::Group::ptr const& group (std::string const& name) override
{ {
return m_groups->get (name); return m_groups->get (name);
} }
@@ -73,10 +74,10 @@ CollectorManager::~CollectorManager ()
{ {
} }
CollectorManager* CollectorManager::New (Section const& params, std::unique_ptr<CollectorManager> CollectorManager::New(Section const& params,
beast::Journal journal) beast::Journal journal)
{ {
return new CollectorManagerImp (params, journal); return std::make_unique<CollectorManagerImp>(params, journal);
} }
} }

View File

@@ -29,11 +29,13 @@ namespace ripple {
class CollectorManager class CollectorManager
{ {
public: public:
static CollectorManager* New (Section const& params, static std::unique_ptr<CollectorManager> New (
beast::Journal journal); Section const& params, beast::Journal journal);
virtual ~CollectorManager () = 0; virtual ~CollectorManager () = 0;
virtual beast::insight::Collector::ptr const& collector () = 0; virtual beast::insight::Collector::ptr const& collector () = 0;
virtual beast::insight::Group::ptr const& group (std::string const& name) = 0; virtual beast::insight::Group::ptr const& group (
std::string const& name) = 0;
}; };
} }

View File

@@ -37,11 +37,11 @@ class LoadManagerImp
, public beast::Thread , public beast::Thread
{ {
public: public:
//--------------------------------------------------------------------------
beast::Journal m_journal;
using LockType = std::mutex; using LockType = std::mutex;
using ScopedLockType = std::lock_guard <LockType>; using ScopedLockType = std::lock_guard <LockType>;
Application& app_;
beast::Journal m_journal;
LockType mLock; LockType mLock;
bool mArmed; bool mArmed;
@@ -49,9 +49,11 @@ public:
int mDeadLock; // Detect server deadlocks int mDeadLock; // Detect server deadlocks
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
LoadManagerImp (Stoppable& parent, beast::Journal journal) LoadManagerImp (Application& app,
Stoppable& parent, beast::Journal journal)
: LoadManager (parent) : LoadManager (parent)
, Thread ("loadmgr") , Thread ("loadmgr")
, app_ (app)
, m_journal (journal) , m_journal (journal)
, mArmed (false) , mArmed (false)
, mDeadLock (0) , mDeadLock (0)
@@ -166,21 +168,21 @@ public:
// VFALCO TODO Eliminate the dependence on the Application object. // VFALCO TODO Eliminate the dependence on the Application object.
// Choices include constructing with the job queue / feetracker. // Choices include constructing with the job queue / feetracker.
// Another option is using an observer pattern to invert the dependency. // Another option is using an observer pattern to invert the dependency.
if (getApp().getJobQueue ().isOverloaded ()) if (app_.getJobQueue ().isOverloaded ())
{ {
if (m_journal.info) if (m_journal.info)
m_journal.info << getApp().getJobQueue ().getJson (0); m_journal.info << app_.getJobQueue ().getJson (0);
change = getApp().getFeeTrack ().raiseLocalFee (); change = app_.getFeeTrack ().raiseLocalFee ();
} }
else else
{ {
change = getApp().getFeeTrack ().lowerLocalFee (); change = app_.getFeeTrack ().lowerLocalFee ();
} }
if (change) if (change)
{ {
// VFALCO TODO replace this with a Listener / observer and subscribe in NetworkOPs or Application // VFALCO TODO replace this with a Listener / observer and subscribe in NetworkOPs or Application
getApp().getOPs ().reportFeeChange (); app_.getOPs ().reportFeeChange ();
} }
t += std::chrono::seconds (1); t += std::chrono::seconds (1);
@@ -211,9 +213,10 @@ LoadManager::LoadManager (Stoppable& parent)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::unique_ptr<LoadManager> std::unique_ptr<LoadManager>
make_LoadManager (beast::Stoppable& parent, beast::Journal journal) make_LoadManager (Application& app,
beast::Stoppable& parent, beast::Journal journal)
{ {
return std::make_unique <LoadManagerImp> (parent, journal); return std::make_unique<LoadManagerImp>(app, parent, journal);
} }
} // ripple } // ripple

View File

@@ -20,6 +20,7 @@
#ifndef RIPPLE_APP_MAIN_LOADMANAGER_H_INCLUDED #ifndef RIPPLE_APP_MAIN_LOADMANAGER_H_INCLUDED
#define RIPPLE_APP_MAIN_LOADMANAGER_H_INCLUDED #define RIPPLE_APP_MAIN_LOADMANAGER_H_INCLUDED
#include <ripple/app/main/Application.h>
#include <beast/threads/Stoppable.h> #include <beast/threads/Stoppable.h>
#include <beast/cxx14/memory.h> // <memory> #include <beast/cxx14/memory.h> // <memory>
@@ -71,7 +72,8 @@ public:
}; };
std::unique_ptr<LoadManager> std::unique_ptr<LoadManager>
make_LoadManager (beast::Stoppable& parent, beast::Journal journal); make_LoadManager (Application& app,
beast::Stoppable& parent, beast::Journal journal);
} // ripple } // ripple

View File

@@ -30,6 +30,11 @@
namespace ripple { namespace ripple {
LocalCredentials::LocalCredentials(Application& app)
: app_ (app)
{
}
void LocalCredentials::start () void LocalCredentials::start ()
{ {
// We need our node identity before we begin networking. // We need our node identity before we begin networking.
@@ -44,16 +49,16 @@ void LocalCredentials::start ()
throw std::runtime_error ("unable to retrieve new node identity."); throw std::runtime_error ("unable to retrieve new node identity.");
} }
if (!getConfig ().QUIET) if (!app_.config().QUIET)
std::cerr << "NodeIdentity: " << mNodePublicKey.humanNodePublic () << std::endl; std::cerr << "NodeIdentity: " << mNodePublicKey.humanNodePublic () << std::endl;
getApp().getUNL ().start (); app_.getUNL ().start ();
} }
// Retrieve network identity. // Retrieve network identity.
bool LocalCredentials::nodeIdentityLoad () bool LocalCredentials::nodeIdentityLoad ()
{ {
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
bool bSuccess = false; bool bSuccess = false;
boost::optional<std::string> pubKO, priKO; boost::optional<std::string> pubKO, priKO;
@@ -71,10 +76,10 @@ bool LocalCredentials::nodeIdentityLoad ()
bSuccess = true; bSuccess = true;
} }
if (getConfig ().NODE_PUB.isValid () && getConfig ().NODE_PRIV.isValid ()) if (app_.config().NODE_PUB.isValid () && app_.config().NODE_PRIV.isValid ())
{ {
mNodePublicKey = getConfig ().NODE_PUB; mNodePublicKey = app_.config().NODE_PUB;
mNodePrivateKey = getConfig ().NODE_PRIV; mNodePrivateKey = app_.config().NODE_PRIV;
} }
return bSuccess; return bSuccess;
@@ -83,7 +88,7 @@ bool LocalCredentials::nodeIdentityLoad ()
// Create and store a network identity. // Create and store a network identity.
bool LocalCredentials::nodeIdentityCreate () bool LocalCredentials::nodeIdentityCreate ()
{ {
if (!getConfig ().QUIET) if (!app_.config().QUIET)
std::cerr << "NodeIdentity: Creating." << std::endl; std::cerr << "NodeIdentity: Creating." << std::endl;
// //
@@ -96,14 +101,14 @@ bool LocalCredentials::nodeIdentityCreate ()
// //
// Store the node information // Store the node information
// //
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
*db << str (boost::format ( *db << str (boost::format (
"INSERT INTO NodeIdentity (PublicKey,PrivateKey) VALUES ('%s','%s');") "INSERT INTO NodeIdentity (PublicKey,PrivateKey) VALUES ('%s','%s');")
% naNodePublic.humanNodePublic () % naNodePublic.humanNodePublic ()
% naNodePrivate.humanNodePrivate ()); % naNodePrivate.humanNodePrivate ());
if (!getConfig ().QUIET) if (!app_.config().QUIET)
std::cerr << "NodeIdentity: Created." << std::endl; std::cerr << "NodeIdentity: Created." << std::endl;
return true; return true;

View File

@@ -20,6 +20,7 @@
#ifndef RIPPLE_APP_MAIN_LOCALCREDENTIALS_H_INCLUDED #ifndef RIPPLE_APP_MAIN_LOCALCREDENTIALS_H_INCLUDED
#define RIPPLE_APP_MAIN_LOCALCREDENTIALS_H_INCLUDED #define RIPPLE_APP_MAIN_LOCALCREDENTIALS_H_INCLUDED
#include <ripple/app/main/Application.h>
#include <ripple/protocol/RippleAddress.h> #include <ripple/protocol/RippleAddress.h>
#include <mutex> #include <mutex>
#include <string> #include <string>
@@ -30,7 +31,7 @@ namespace ripple {
class LocalCredentials class LocalCredentials
{ {
public: public:
LocalCredentials () = default; LocalCredentials (Application& app);
LocalCredentials (LocalCredentials const&) = delete; LocalCredentials (LocalCredentials const&) = delete;
LocalCredentials& operator= (LocalCredentials const&) = delete; LocalCredentials& operator= (LocalCredentials const&) = delete;
@@ -53,6 +54,7 @@ private:
bool nodeIdentityCreate (); bool nodeIdentityCreate ();
private: private:
Application& app_;
std::recursive_mutex mLock; std::recursive_mutex mLock;
RippleAddress mNodePublicKey; RippleAddress mNodePublicKey;

View File

@@ -53,7 +53,7 @@ namespace po = boost::program_options;
namespace ripple { namespace ripple {
void setupServer () void setupServer (Application& app)
{ {
#ifdef RLIMIT_NOFILE #ifdef RLIMIT_NOFILE
struct rlimit rl; struct rlimit rl;
@@ -67,48 +67,52 @@ void setupServer ()
} }
#endif #endif
getApp().setup (); app.setup ();
} }
boost::filesystem::path boost::filesystem::path
getEntropyFile() getEntropyFile(Config const& config)
{ {
return boost::filesystem::path ( auto const path = config.legacy("database_path");
getConfig().legacy("database_path")) / "random.seed"; if (path.empty ())
return {};
return boost::filesystem::path (path) / "random.seed";
} }
void startServer () void startServer (Application& app)
{ {
// //
// Execute start up rpc commands. // Execute start up rpc commands.
// //
if (getConfig ().RPC_STARTUP.isArray ()) if (app.config().RPC_STARTUP.isArray ())
{ {
for (int i = 0; i != getConfig ().RPC_STARTUP.size (); ++i) for (int i = 0; i != app.config().RPC_STARTUP.size (); ++i)
{ {
Json::Value const& jvCommand = getConfig ().RPC_STARTUP[i]; Json::Value const& jvCommand = app.config().RPC_STARTUP[i];
if (!getConfig ().QUIET) if (!app.config().QUIET)
std::cerr << "Startup RPC: " << jvCommand << std::endl; std::cerr << "Startup RPC: " << jvCommand << std::endl;
Resource::Charge loadType = Resource::feeReferenceRPC; Resource::Charge loadType = Resource::feeReferenceRPC;
RPC::Context context { RPC::Context context {
jvCommand, loadType, getApp().getOPs (), app.journal ("RPCHandler"), jvCommand, app, loadType, app.getOPs (),
getApp().getLedgerMaster(), Role::ADMIN}; app.getLedgerMaster(), Role::ADMIN, app};
Json::Value jvResult; Json::Value jvResult;
RPC::doCommand (context, jvResult); RPC::doCommand (context, jvResult);
if (!getConfig ().QUIET) if (!app.config().QUIET)
std::cerr << "Result: " << jvResult << std::endl; std::cerr << "Result: " << jvResult << std::endl;
} }
} }
// Block until we get a stop RPC. // Block until we get a stop RPC.
getApp().run (); app.run ();
// Try to write out some entropy to use the next time we start. // Try to write out some entropy to use the next time we start.
stir_entropy (getEntropyFile ().string ()); auto entropy = getEntropyFile (app.config());
if (!entropy.empty ())
stir_entropy (entropy.string ());
} }
void printHelp (const po::options_description& desc) void printHelp (const po::options_description& desc)
@@ -146,14 +150,10 @@ void printHelp (const po::options_description& desc)
" version\n" " version\n"
" server_info\n" " server_info\n"
" sign <private_key> <json> [offline]\n" " sign <private_key> <json> [offline]\n"
#if RIPPLE_ENABLE_MULTI_SIGN
" sign_for\n" " sign_for\n"
#endif // RIPPLE_ENABLE_MULTI_SIGN
" stop\n" " stop\n"
" submit <tx_blob>|[<private_key> <json>]\n" " submit <tx_blob>|[<private_key> <json>]\n"
#if RIPPLE_ENABLE_MULTI_SIGN
" submit_multisigned\n" " submit_multisigned\n"
#endif // RIPPLE_ENABLE_MULTI_SIGN
" tx <id>\n" " tx <id>\n"
" validation_create [<seed>|<pass_phrase>|<key>]\n" " validation_create [<seed>|<pass_phrase>|<key>]\n"
" validation_seed [<seed>|<pass_phrase>|<key>]\n" " validation_seed [<seed>|<pass_phrase>|<key>]\n"
@@ -173,18 +173,22 @@ setupConfigForUnitTests (Config& config)
config.legacy("database_path", "DummyForUnitTests"); config.legacy("database_path", "DummyForUnitTests");
} }
static int runShutdownTests () static int runShutdownTests (std::unique_ptr<Config> config)
{ {
// Shutdown tests can not be part of the normal unit tests in 'runUnitTests' // Shutdown tests can not be part of the normal unit tests in 'runUnitTests'
// because it needs to create and destroy an application object. // because it needs to create and destroy an application object.
int const numShutdownIterations = 20; // FIXME: we only loop once, since the Config object will get destroyed
int const numShutdownIterations = 1; //20;
// Give it enough time to sync and run a bit while synced. // Give it enough time to sync and run a bit while synced.
std::chrono::seconds const serverUptimePerIteration (4 * 60); std::chrono::seconds const serverUptimePerIteration (4 * 60);
for (int i = 0; i < numShutdownIterations; ++i) for (int i = 0; i < numShutdownIterations; ++i)
{ {
std::cerr << "\n\nStarting server. Iteration: " << i << "\n" std::cerr << "\n\nStarting server. Iteration: " << i << "\n"
<< std::endl; << std::endl;
std::unique_ptr<Application> app (make_Application (deprecatedLogs())); auto app = make_Application (
std::move(config),
std::make_unique<Logs>());
auto shutdownApp = [&app](std::chrono::seconds sleepTime, int iteration) auto shutdownApp = [&app](std::chrono::seconds sleepTime, int iteration)
{ {
std::this_thread::sleep_for (sleepTime); std::this_thread::sleep_for (sleepTime);
@@ -193,20 +197,25 @@ static int runShutdownTests ()
app->signalStop(); app->signalStop();
}; };
std::thread shutdownThread (shutdownApp, serverUptimePerIteration, i); std::thread shutdownThread (shutdownApp, serverUptimePerIteration, i);
setupServer(); setupServer(*app);
startServer(); startServer(*app);
shutdownThread.join(); shutdownThread.join();
} }
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
static int runUnitTests (std::string const& pattern, static int runUnitTests (
std::unique_ptr<Config> config,
std::string const& pattern,
std::string const& argument) std::string const& argument)
{ {
// Config needs to be set up before creating Application // Config needs to be set up before creating Application
setupConfigForUnitTests (getConfig ()); setupConfigForUnitTests (*config);
// VFALCO TODO Remove dependence on constructing Application object
std::unique_ptr <Application> app (make_Application (deprecatedLogs())); auto app = make_Application (
std::move(config),
std::make_unique<Logs>());
using namespace beast::unit_test; using namespace beast::unit_test;
beast::debug_ostream stream; beast::debug_ostream stream;
reporter r (stream); reporter r (stream);
@@ -228,52 +237,6 @@ int run (int argc, char** argv)
using namespace std; using namespace std;
setCallingThreadName ("main"); setCallingThreadName ("main");
int iResult = 0;
po::variables_map vm;
std::string importText;
{
importText += "Import an existing node database (specified in the [";
importText += ConfigSection::importNodeDatabase ();
importText += "] configuration file section) into the current ";
importText += "node database (specified in the [";
importText += ConfigSection::nodeDatabase ();
importText += "] configuration file section).";
}
// VFALCO TODO Replace boost program options with something from Beast.
//
// Set up option parsing.
//
po::options_description desc ("General Options");
desc.add_options ()
("help,h", "Display this message.")
("conf", po::value<std::string> (), "Specify the configuration file.")
("rpc", "Perform rpc command (default).")
("rpc_ip", po::value <std::string> (), "Specify the IP address for RPC command. Format: <ip-address>[':'<port-number>]")
("rpc_port", po::value <int> (), "Specify the port number for RPC command.")
("standalone,a", "Run with no peers.")
("shutdowntest", po::value <std::string> ()->implicit_value (""), "Perform shutdown tests.")
("unittest,u", po::value <std::string> ()->implicit_value (""), "Perform unit tests.")
("unittest-arg", po::value <std::string> ()->implicit_value (""), "Supplies argument to unit tests.")
("parameters", po::value< vector<string> > (), "Specify comma separated parameters.")
("quiet,q", "Reduce diagnotics.")
("quorum", po::value <int> (), "Set the validation quorum.")
("verbose,v", "Verbose logging.")
("load", "Load the current ledger from the local DB.")
("replay","Replay a ledger close.")
("ledger", po::value<std::string> (), "Load the specified ledger and start from .")
("ledgerfile", po::value<std::string> (), "Load the specified ledger file.")
("start", "Start from a fresh Ledger.")
("net", "Get the initial ledger from the network.")
("fg", "Run in the foreground.")
("import", importText.c_str ())
("version", "Display the build version.")
;
// Interpret positional arguments as --parameters.
po::positional_options_description p;
p.add ("parameters", -1);
{ {
// We want to seed the RNG early. We acquire a small amount of // We want to seed the RNG early. We acquire a small amount of
@@ -299,8 +262,51 @@ int run (int argc, char** argv)
add_entropy (entropy.get (), sizeof (entropy_t)); add_entropy (entropy.get (), sizeof (entropy_t));
} }
if (!iResult) po::variables_map vm;
std::string importText;
{ {
importText += "Import an existing node database (specified in the [";
importText += ConfigSection::importNodeDatabase ();
importText += "] configuration file section) into the current ";
importText += "node database (specified in the [";
importText += ConfigSection::nodeDatabase ();
importText += "] configuration file section).";
}
// Set up option parsing.
//
po::options_description desc ("General Options");
desc.add_options ()
("help,h", "Display this message.")
("conf", po::value<std::string> (), "Specify the configuration file.")
("rpc", "Perform rpc command (default).")
("rpc_ip", po::value <std::string> (), "Specify the IP address for RPC command. Format: <ip-address>[':'<port-number>]")
("rpc_port", po::value <std::uint16_t> (), "Specify the port number for RPC command.")
("standalone,a", "Run with no peers.")
("shutdowntest", po::value <std::string> ()->implicit_value (""), "Perform shutdown tests.")
("unittest,u", po::value <std::string> ()->implicit_value (""), "Perform unit tests.")
("unittest-arg", po::value <std::string> ()->implicit_value (""), "Supplies argument to unit tests.")
("parameters", po::value< vector<string> > (), "Specify comma separated parameters.")
("quiet,q", "Reduce diagnotics.")
("quorum", po::value <int> (), "Set the validation quorum.")
("verbose,v", "Verbose logging.")
("load", "Load the current ledger from the local DB.")
("valid", "Consider the initial ledger a valid network ledger.")
("replay","Replay a ledger close.")
("ledger", po::value<std::string> (), "Load the specified ledger and start from .")
("ledgerfile", po::value<std::string> (), "Load the specified ledger file.")
("start", "Start from a fresh Ledger.")
("net", "Get the initial ledger from the network.")
("fg", "Run in the foreground.")
("import", importText.c_str ())
("version", "Display the build version.")
;
// Interpret positional arguments as --parameters.
po::positional_options_description p;
p.add ("parameters", -1);
// Parse options, if no error. // Parse options, if no error.
try try
{ {
@@ -313,13 +319,15 @@ int run (int argc, char** argv)
} }
catch (...) catch (...)
{ {
iResult = 1; std::cerr << "rippled: Incorrect command line syntax." << std::endl;
} std::cerr << "Use '--help' for a list of options." << std::endl;
return 1;
} }
if (!iResult && vm.count ("help")) if (vm.count ("help"))
{ {
iResult = 1; printHelp (desc);
return 0;
} }
if (vm.count ("version")) if (vm.count ("version"))
@@ -332,32 +340,18 @@ int run (int argc, char** argv)
// Use a watchdog process unless we're invoking a stand alone type of mode // Use a watchdog process unless we're invoking a stand alone type of mode
// //
if (HaveSustain () if (HaveSustain ()
&& !iResult
&& !vm.count ("parameters") && !vm.count ("parameters")
&& !vm.count ("fg") && !vm.count ("fg")
&& !vm.count ("standalone") && !vm.count ("standalone")
&& !vm.count ("shutdowntest") && !vm.count ("shutdowntest")
&& !vm.count ("unittest")) && !vm.count ("unittest"))
{ {
std::string logMe = DoSustain (getConfig ().getDebugLogFile ().string()); std::string logMe = DoSustain ();
if (!logMe.empty ()) if (!logMe.empty ())
std::cerr << logMe; std::cerr << logMe;
} }
if (vm.count ("quiet"))
{
deprecatedLogs().severity(beast::Journal::kFatal);
}
else if (vm.count ("verbose"))
{
deprecatedLogs().severity(beast::Journal::kTrace);
}
else
{
deprecatedLogs().severity(beast::Journal::kInfo);
}
// Run the unit tests if requested. // Run the unit tests if requested.
// The unit tests will exit the application with an appropriate return code. // The unit tests will exit the application with an appropriate return code.
// //
@@ -368,79 +362,90 @@ int run (int argc, char** argv)
if (vm.count("unittest-arg")) if (vm.count("unittest-arg"))
argument = vm["unittest-arg"].as<std::string>(); argument = vm["unittest-arg"].as<std::string>();
return runUnitTests(vm["unittest"].as<std::string>(), argument); return runUnitTests(
std::make_unique<Config> (),
vm["unittest"].as<std::string>(),
argument);
} }
if (!iResult) auto config = std::make_unique<Config>();
{
auto configFile = vm.count ("conf") ? auto configFile = vm.count ("conf") ?
vm["conf"].as<std::string> () : std::string(); vm["conf"].as<std::string> () : std::string();
// config file, quiet flag. // config file, quiet flag.
getConfig ().setup (configFile, bool (vm.count ("quiet"))); config->setup (configFile, bool (vm.count ("quiet")));
if (vm.count ("standalone")) if (vm.count ("standalone"))
{ {
getConfig ().RUN_STANDALONE = true; config->RUN_STANDALONE = true;
getConfig ().LEDGER_HISTORY = 0; config->LEDGER_HISTORY = 0;
} }
// Use any previously available entropy to stir the pool // Use any previously available entropy to stir the pool
stir_entropy (getEntropyFile ().string ()); auto entropy = getEntropyFile (*config);
} if (!entropy.empty ())
stir_entropy (entropy.string ());
if (vm.count ("start")) getConfig ().START_UP = Config::FRESH; if (vm.count ("start"))
config->START_UP = Config::FRESH;
// Handle a one-time import option
//
if (vm.count ("import")) if (vm.count ("import"))
{ config->doImport = true;
getConfig ().doImport = true;
}
if (vm.count ("ledger")) if (vm.count ("ledger"))
{ {
getConfig ().START_LEDGER = vm["ledger"].as<std::string> (); config->START_LEDGER = vm["ledger"].as<std::string> ();
if (vm.count("replay")) if (vm.count("replay"))
getConfig ().START_UP = Config::REPLAY; config->START_UP = Config::REPLAY;
else else
getConfig ().START_UP = Config::LOAD; config->START_UP = Config::LOAD;
} }
else if (vm.count ("ledgerfile")) else if (vm.count ("ledgerfile"))
{ {
getConfig ().START_LEDGER = vm["ledgerfile"].as<std::string> (); config->START_LEDGER = vm["ledgerfile"].as<std::string> ();
getConfig ().START_UP = Config::LOAD_FILE; config->START_UP = Config::LOAD_FILE;
} }
else if (vm.count ("load")) else if (vm.count ("load"))
{ {
getConfig ().START_UP = Config::LOAD; config->START_UP = Config::LOAD;
}
else if (vm.count ("net"))
{
getConfig ().START_UP = Config::NETWORK;
if (getConfig ().VALIDATION_QUORUM < 2)
getConfig ().VALIDATION_QUORUM = 2;
} }
if (iResult == 0) if (vm.count ("valid"))
{ {
// These overrides must happen after the config file is loaded. config->START_VALID = true;
}
// Override the RPC destination IP address if (vm.count ("net"))
// {
if ((config->START_UP == Config::LOAD) ||
(config->START_UP == Config::REPLAY))
{
std::cerr <<
"Net and load/reply options are incompatible" << std::endl;
return -1;
}
config->START_UP = Config::NETWORK;
if (config->VALIDATION_QUORUM < 2)
config->VALIDATION_QUORUM = 2;
}
// Override the RPC destination IP address. This must
// happen after the config file is loaded.
if (vm.count ("rpc_ip")) if (vm.count ("rpc_ip"))
{ {
try try
{ {
getConfig().rpc_ip = config->rpc_ip.emplace (
boost::asio::ip::address_v4::from_string( boost::asio::ip::address_v4::from_string(
vm["rpc_ip"].as<std::string>()); vm["rpc_ip"].as<std::string>()));
} }
catch(...) catch(...)
{ {
std::cerr << std::cerr << "Invalid rpc_ip = " <<
"Invalid rpc_ip = " << vm["rpc_ip"].as<std::string>(); vm["rpc_ip"].as<std::string>() << std::endl;
return -1; return -1;
} }
} }
@@ -451,53 +456,66 @@ int run (int argc, char** argv)
{ {
try try
{ {
getConfig().rpc_port = vm["rpc_port"].as<int>(); config->rpc_port.emplace (
vm["rpc_port"].as<std::uint16_t>());
if (*config->rpc_port == 0)
throw std::domain_error ("");
} }
catch(...) catch(...)
{ {
std::cerr << std::cerr << "Invalid rpc_port = " <<
"Invalid rpc_port = " << vm["rpc_port"].as<std::string>(); vm["rpc_port"].as<std::string>() << std::endl;
return -1; return -1;
} }
} }
if (vm.count ("quorum")) if (vm.count ("quorum"))
{ {
getConfig ().VALIDATION_QUORUM = vm["quorum"].as <int> (); try
{
config->VALIDATION_QUORUM = vm["quorum"].as <int> ();
config->LOCK_QUORUM = true;
if (getConfig ().VALIDATION_QUORUM < 0) if (config->VALIDATION_QUORUM < 0)
iResult = 1; throw std::domain_error ("");
}
catch(...)
{
std::cerr << "Invalid quorum = " <<
vm["quorum"].as <std::string> () << std::endl;
return -1;
} }
} }
if (vm.count ("shutdowntest")) if (vm.count ("shutdowntest"))
{ return runShutdownTests (std::move(config));
return runShutdownTests ();
}
if (iResult == 0) // No arguments. Run server.
{
if (!vm.count ("parameters")) if (!vm.count ("parameters"))
{ {
// No arguments. Run server. auto logs = std::make_unique<Logs>();
std::unique_ptr <Application> app (make_Application (deprecatedLogs()));
setupServer (); if (vm.count ("quiet"))
startServer (); logs->severity (beast::Journal::kFatal);
} else if (vm.count ("verbose"))
logs->severity (beast::Journal::kTrace);
else else
{ logs->severity (beast::Journal::kInfo);
// Have a RPC command.
auto app = make_Application (
std::move(config),
std::move (logs));
setupServer (*app);
startServer (*app);
return 0;
}
// We have an RPC command to process:
setCallingThreadName ("rpc"); setCallingThreadName ("rpc");
std::vector<std::string> vCmd = vm["parameters"].as<std::vector<std::string> > (); return RPCCall::fromCommandLine (
*config,
iResult = RPCCall::fromCommandLine (vCmd); vm["parameters"].as<std::vector<std::string>>(), deprecatedLogs());
}
}
if (1 == iResult && !vm.count ("quiet"))
printHelp (desc);
return iResult;
} }
extern int run (int argc, char** argv); extern int run (int argc, char** argv);

View File

@@ -50,11 +50,10 @@ void NodeStoreScheduler::scheduleTask (NodeStore::Task& task)
m_jobQueue->addJob ( m_jobQueue->addJob (
jtWRITE, jtWRITE,
"NodeObject::store", "NodeObject::store",
std::bind (&NodeStoreScheduler::doTask, [this, &task] (Job&) { doTask(task); });
this, std::ref(task), std::placeholders::_1));
} }
void NodeStoreScheduler::doTask (NodeStore::Task& task, Job&) void NodeStoreScheduler::doTask (NodeStore::Task& task)
{ {
task.performScheduledTask (); task.performScheduledTask ();
if ((--m_taskCount == 0) && isStopping()) if ((--m_taskCount == 0) && isStopping())

View File

@@ -40,14 +40,14 @@ public:
// //
void setJobQueue (JobQueue& jobQueue); void setJobQueue (JobQueue& jobQueue);
void onStop (); void onStop () override;
void onChildrenStopped (); void onChildrenStopped () override;
void scheduleTask (NodeStore::Task& task); void scheduleTask (NodeStore::Task& task) override;
void onFetch (NodeStore::FetchReport const& report) override; void onFetch (NodeStore::FetchReport const& report) override;
void onBatchWrite (NodeStore::BatchWriteReport const& report) override; void onBatchWrite (NodeStore::BatchWriteReport const& report) override;
private: private:
void doTask (NodeStore::Task& task, Job&); void doTask (NodeStore::Task& task);
JobQueue* m_jobQueue; JobQueue* m_jobQueue;
std::atomic <int> m_taskCount; std::atomic <int> m_taskCount;

View File

@@ -76,17 +76,17 @@ public:
using const_iterator = std::map <Key, std::shared_ptr<STTx const>>::const_iterator; using const_iterator = std::map <Key, std::shared_ptr<STTx const>>::const_iterator;
public: public:
explicit CanonicalTXSet (LedgerHash const& lastClosedLedgerHash) explicit CanonicalTXSet (LedgerHash const& saltHash)
: mSetHash (lastClosedLedgerHash) : mSetHash (saltHash)
{ {
} }
void insert (std::shared_ptr<STTx const> const& txn); void insert (std::shared_ptr<STTx const> const& txn);
// VFALCO TODO remove this function // VFALCO TODO remove this function
void reset (LedgerHash const& newLastClosedLedgerHash) void reset (LedgerHash const& saltHash)
{ {
mSetHash = newLastClosedLedgerHash; mSetHash = saltHash;
mMap.clear (); mMap.clear ();
} }

View File

@@ -41,6 +41,9 @@ public:
/** The cost of a reference transaction in drops. */ /** The cost of a reference transaction in drops. */
std::uint64_t reference_fee = 10; std::uint64_t reference_fee = 10;
/** The cost of a reference transaction in fee units. */
std::uint32_t const reference_fee_units = 10;
/** The account reserve requirement in drops. */ /** The account reserve requirement in drops. */
std::uint64_t account_reserve = 20 * SYSTEM_CURRENCY_PARTS; std::uint64_t account_reserve = 20 * SYSTEM_CURRENCY_PARTS;

View File

@@ -18,6 +18,7 @@
//============================================================================== //==============================================================================
#include <BeastConfig.h> #include <BeastConfig.h>
#include <ripple/protocol/st.h>
#include <ripple/app/misc/FeeVote.h> #include <ripple/app/misc/FeeVote.h>
#include <ripple/app/main/Application.h> #include <ripple/app/main/Application.h>
#include <ripple/app/misc/Validations.h> #include <ripple/app/misc/Validations.h>
@@ -118,7 +119,7 @@ void
FeeVoteImpl::doValidation (Ledger::ref lastClosedLedger, FeeVoteImpl::doValidation (Ledger::ref lastClosedLedger,
STObject& baseValidation) STObject& baseValidation)
{ {
if (lastClosedLedger->getBaseFee () != target_.reference_fee) if (lastClosedLedger->fees().base != target_.reference_fee)
{ {
if (journal_.info) journal_.info << if (journal_.info) journal_.info <<
"Voting for base fee of " << target_.reference_fee; "Voting for base fee of " << target_.reference_fee;
@@ -126,7 +127,7 @@ FeeVoteImpl::doValidation (Ledger::ref lastClosedLedger,
baseValidation.setFieldU64 (sfBaseFee, target_.reference_fee); baseValidation.setFieldU64 (sfBaseFee, target_.reference_fee);
} }
if (lastClosedLedger->getReserve (0) != target_.account_reserve) if (lastClosedLedger->fees().accountReserve(0) != target_.account_reserve)
{ {
if (journal_.info) journal_.info << if (journal_.info) journal_.info <<
"Voting for base resrve of " << target_.account_reserve; "Voting for base resrve of " << target_.account_reserve;
@@ -134,7 +135,7 @@ FeeVoteImpl::doValidation (Ledger::ref lastClosedLedger,
baseValidation.setFieldU32(sfReserveBase, target_.account_reserve); baseValidation.setFieldU32(sfReserveBase, target_.account_reserve);
} }
if (lastClosedLedger->getReserveInc () != target_.owner_reserve) if (lastClosedLedger->fees().increment != target_.owner_reserve)
{ {
if (journal_.info) journal_.info << if (journal_.info) journal_.info <<
"Voting for reserve increment of " << target_.owner_reserve; "Voting for reserve increment of " << target_.owner_reserve;
@@ -153,13 +154,13 @@ FeeVoteImpl::doVoting (Ledger::ref lastClosedLedger,
assert ((lastClosedLedger->info().seq % 256) == 0); assert ((lastClosedLedger->info().seq % 256) == 0);
detail::VotableInteger<std::uint64_t> baseFeeVote ( detail::VotableInteger<std::uint64_t> baseFeeVote (
lastClosedLedger->getBaseFee (), target_.reference_fee); lastClosedLedger->fees().base, target_.reference_fee);
detail::VotableInteger<std::uint32_t> baseReserveVote ( detail::VotableInteger<std::uint32_t> baseReserveVote (
lastClosedLedger->getReserve (0), target_.account_reserve); lastClosedLedger->fees().accountReserve(0).drops(), target_.account_reserve);
detail::VotableInteger<std::uint32_t> incReserveVote ( detail::VotableInteger<std::uint32_t> incReserveVote (
lastClosedLedger->getReserveInc (), target_.owner_reserve); lastClosedLedger->fees().increment, target_.owner_reserve);
for (auto const& e : set) for (auto const& e : set)
{ {
@@ -202,9 +203,9 @@ FeeVoteImpl::doVoting (Ledger::ref lastClosedLedger,
std::uint32_t const incReserve = incReserveVote.getVotes (); std::uint32_t const incReserve = incReserveVote.getVotes ();
// add transactions to our position // add transactions to our position
if ((baseFee != lastClosedLedger->getBaseFee ()) || if ((baseFee != lastClosedLedger->fees().base) ||
(baseReserve != lastClosedLedger->getReserve (0)) || (baseReserve != lastClosedLedger->fees().accountReserve(0)) ||
(incReserve != lastClosedLedger->getReserveInc ())) (incReserve != lastClosedLedger->fees().increment))
{ {
if (journal_.warning) journal_.warning << if (journal_.warning) journal_.warning <<
"We are voting for a fee change: " << baseFee << "We are voting for a fee change: " << baseFee <<
@@ -212,11 +213,11 @@ FeeVoteImpl::doVoting (Ledger::ref lastClosedLedger,
"/" << incReserve; "/" << incReserve;
STTx trans (ttFEE); STTx trans (ttFEE);
trans.setAccountID (sfAccount, AccountID ()); trans[sfAccount] = AccountID();
trans.setFieldU64 (sfBaseFee, baseFee); trans[sfBaseFee] = baseFee;
trans.setFieldU32 (sfReferenceFeeUnits, 10); trans[sfReferenceFeeUnits] = target_.reference_fee_units;
trans.setFieldU32 (sfReserveBase, baseReserve); trans[sfReserveBase] = baseReserve;
trans.setFieldU32 (sfReserveIncrement, incReserve); trans[sfReserveIncrement] = incReserve;
uint256 txID = trans.getTransactionID (); uint256 txID = trans.getTransactionID ();

View File

@@ -18,112 +18,35 @@
//============================================================================== //==============================================================================
#include <BeastConfig.h> #include <BeastConfig.h>
#include <ripple/app/misc/IHashRouter.h> #include <ripple/app/misc/HashRouter.h>
#include <ripple/basics/CountedObject.h> #include <ripple/protocol/STTx.h>
#include <ripple/basics/UnorderedContainers.h>
#include <ripple/basics/UptimeTimer.h> #include <ripple/basics/UptimeTimer.h>
#include <map> #include <map>
#include <mutex> #include <mutex>
namespace ripple { namespace ripple {
// VFALCO TODO Inline the function definitions std::function<bool(STTx const&, std::function<bool(STTx const&)>)>
class HashRouter : public IHashRouter HashRouter::sigVerify()
{ {
private: return
/** An entry in the routing table. [&] (STTx const& tx, std::function<bool(STTx const&)> sigCheck)
*/
class Entry : public CountedObject <Entry>
{ {
public: auto const id = tx.getTransactionID();
static char const* getCountedObjectName () { return "HashRouterEntry"; } auto const flags = getFlags(id);
if (flags & SF_SIGGOOD)
Entry () return true;
: mFlags (0) if (flags & SF_BAD)
return false;
if (! sigCheck(tx))
{ {
setFlags(id, SF_BAD);
return false;
} }
setFlags(id, SF_SIGGOOD);
std::set <PeerShortID> const& peekPeers () const return true;
{
return mPeers;
}
void addPeer (PeerShortID peer)
{
if (peer != 0)
mPeers.insert (peer);
}
bool hasPeer (PeerShortID peer) const
{
return mPeers.count (peer) > 0;
}
int getFlags (void) const
{
return mFlags;
}
bool hasFlag (int mask) const
{
return (mFlags & mask) != 0;
}
void setFlag (int flagsToSet)
{
mFlags |= flagsToSet;
}
void clearFlag (int flagsToClear)
{
mFlags &= ~flagsToClear;
}
void swapSet (std::set <PeerShortID>& other)
{
mPeers.swap (other);
}
private:
int mFlags;
std::set <PeerShortID> mPeers;
}; };
}
public:
explicit HashRouter (int holdTime)
: mHoldTime (holdTime)
{
}
bool addSuppression (uint256 const& index);
bool addSuppressionPeer (uint256 const& index, PeerShortID peer);
bool addSuppressionPeer (uint256 const& index, PeerShortID peer, int& flags);
bool addSuppressionFlags (uint256 const& index, int flag);
bool setFlag (uint256 const& index, int flag);
int getFlags (uint256 const& index);
bool swapSet (uint256 const& index, std::set<PeerShortID>& peers, int flag);
private:
Entry getEntry (uint256 const& );
Entry& findCreateEntry (uint256 const& , bool& created);
using MutexType = std::mutex;
using ScopedLockType = std::lock_guard <MutexType>;
MutexType mMutex;
// Stores all suppressed hashes and their expiration time
hash_map <uint256, Entry> mSuppressionMap;
// Stores all expiration times and the hashes indexed for them
std::map< int, std::list<uint256> > mSuppressionTimes;
int mHoldTime;
};
//------------------------------------------------------------------------------
HashRouter::Entry& HashRouter::findCreateEntry (uint256 const& index, bool& created) HashRouter::Entry& HashRouter::findCreateEntry (uint256 const& index, bool& created)
{ {
@@ -204,28 +127,28 @@ bool HashRouter::addSuppressionFlags (uint256 const& index, int flag)
ScopedLockType lock (mMutex); ScopedLockType lock (mMutex);
bool created; bool created;
findCreateEntry (index, created).setFlag (flag); findCreateEntry (index, created).setFlags (flag);
return created; return created;
} }
bool HashRouter::setFlag (uint256 const& index, int flag) bool HashRouter::setFlags (uint256 const& index, int flags)
{ {
// VFALCO NOTE Comments like this belong in the HEADER file, // VFALCO NOTE Comments like this belong in the HEADER file,
// and more importantly in a Javadoc comment so // and more importantly in a Javadoc comment so
// they appear in the generated documentation. // they appear in the generated documentation.
// //
// return: true = changed, false = unchanged // return: true = changed, false = unchanged
assert (flag != 0); assert (flags != 0);
ScopedLockType lock (mMutex); ScopedLockType lock (mMutex);
bool created; bool created;
Entry& s = findCreateEntry (index, created); Entry& s = findCreateEntry (index, created);
if ((s.getFlags () & flag) == flag) if ((s.getFlags () & flags) == flags)
return false; return false;
s.setFlag (flag); s.setFlags (flags);
return true; return true;
} }
@@ -240,14 +163,9 @@ bool HashRouter::swapSet (uint256 const& index, std::set<PeerShortID>& peers, in
return false; return false;
s.swapSet (peers); s.swapSet (peers);
s.setFlag (flag); s.setFlags (flag);
return true; return true;
} }
IHashRouter* IHashRouter::New (int holdTime)
{
return new HashRouter (holdTime);
}
} // ripple } // ripple

View File

@@ -0,0 +1,180 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_APP_MISC_HASHROUTER_H_INCLUDED
#define RIPPLE_APP_MISC_HASHROUTER_H_INCLUDED
#include <ripple/basics/base_uint.h>
#include <ripple/basics/CountedObject.h>
#include <ripple/basics/UnorderedContainers.h>
#include <cstdint>
#include <functional>
#include <set>
namespace ripple {
class STTx;
// VFALCO NOTE Are these the flags?? Why aren't we using a packed struct?
// VFALCO TODO convert these macros to int constants
#define SF_RELAYED 0x01 // Has already been relayed to other nodes
// VFALCO NOTE How can both bad and good be set on a hash?
#define SF_BAD 0x02 // Signature/format is bad
#define SF_SIGGOOD 0x04 // Signature is good
#define SF_SAVED 0x08
#define SF_RETRY 0x10 // Transaction can be retried
#define SF_TRUSTED 0x20 // comes from trusted source
/** Routing table for objects identified by hash.
This table keeps track of which hashes have been received by which peers.
It is used to manage the routing and broadcasting of messages in the peer
to peer overlay.
*/
class HashRouter
{
public:
// The type here *MUST* match the type of Peer::id_t
using PeerShortID = std::uint32_t;
private:
/** An entry in the routing table.
*/
class Entry : public CountedObject <Entry>
{
public:
static char const* getCountedObjectName () { return "HashRouterEntry"; }
Entry ()
: mFlags (0)
{
}
std::set <PeerShortID> const& peekPeers () const
{
return mPeers;
}
void addPeer (PeerShortID peer)
{
if (peer != 0)
mPeers.insert (peer);
}
bool hasPeer (PeerShortID peer) const
{
return mPeers.count (peer) > 0;
}
int getFlags (void) const
{
return mFlags;
}
bool hasFlag (int mask) const
{
return (mFlags & mask) != 0;
}
void setFlags (int flagsToSet)
{
mFlags |= flagsToSet;
}
void clearFlag (int flagsToClear)
{
mFlags &= ~flagsToClear;
}
void swapSet (std::set <PeerShortID>& other)
{
mPeers.swap (other);
}
private:
int mFlags;
std::set <PeerShortID> mPeers;
};
public:
// VFALCO NOTE this preferred alternative to default parameters makes
// behavior clear.
//
static inline int getDefaultHoldTime ()
{
return 300;
}
explicit HashRouter (int entryHoldTimeInSeconds)
: mHoldTime (entryHoldTimeInSeconds)
{
}
virtual ~HashRouter() = default;
// VFALCO TODO Replace "Supression" terminology with something more
// semantically meaningful.
bool addSuppression (uint256 const& index);
bool addSuppressionPeer (uint256 const& index, PeerShortID peer);
bool addSuppressionPeer (uint256 const& index, PeerShortID peer,
int& flags);
bool addSuppressionFlags (uint256 const& index, int flag);
/** Set the flags on a hash.
@return `true` if the flags were changed.
*/
bool setFlags (uint256 const& index, int flags);
int getFlags (uint256 const& index);
bool swapSet (uint256 const& index, std::set<PeerShortID>& peers, int flag);
/**
Function wrapper that will check the signature status
of a STTx before calling an expensive signature
checking function.
*/
std::function<bool(STTx const&, std::function<bool(STTx const&)>)>
sigVerify();
private:
Entry getEntry (uint256 const& );
Entry& findCreateEntry (uint256 const& , bool& created);
using MutexType = std::mutex;
using ScopedLockType = std::lock_guard <MutexType>;
MutexType mMutex;
// Stores all suppressed hashes and their expiration time
hash_map <uint256, Entry> mSuppressionMap;
// Stores all expiration times and the hashes indexed for them
std::map< int, std::list<uint256> > mSuppressionTimes;
int mHoldTime;
};
} // ripple
#endif

View File

@@ -1,87 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_APP_MISC_IHASHROUTER_H_INCLUDED
#define RIPPLE_APP_MISC_IHASHROUTER_H_INCLUDED
#include <ripple/basics/base_uint.h>
#include <cstdint>
#include <set>
namespace ripple {
// VFALCO NOTE Are these the flags?? Why aren't we using a packed struct?
// VFALCO TODO convert these macros to int constants
#define SF_RELAYED 0x01 // Has already been relayed to other nodes
// VFALCO NOTE How can both bad and good be set on a hash?
#define SF_BAD 0x02 // Signature/format is bad
#define SF_SIGGOOD 0x04 // Signature is good
#define SF_SAVED 0x08
#define SF_RETRY 0x10 // Transaction can be retried
#define SF_TRUSTED 0x20 // comes from trusted source
/** Routing table for objects identified by hash.
This table keeps track of which hashes have been received by which peers.
It is used to manage the routing and broadcasting of messages in the peer
to peer overlay.
*/
class IHashRouter
{
public:
// The type here *MUST* match the type of Peer::id_t
using PeerShortID = std::uint32_t;
// VFALCO NOTE this preferred alternative to default parameters makes
// behavior clear.
//
static inline int getDefaultHoldTime ()
{
return 300;
}
// VFALCO TODO rename the parameter to entryHoldTimeInSeconds
static IHashRouter* New (int holdTime);
virtual ~IHashRouter () { }
// VFALCO TODO Replace "Supression" terminology with something more semantically meaningful.
virtual bool addSuppression (uint256 const& index) = 0;
virtual bool addSuppressionPeer (uint256 const& index, PeerShortID peer) = 0;
virtual bool addSuppressionPeer (uint256 const& index, PeerShortID peer, int& flags) = 0;
virtual bool addSuppressionFlags (uint256 const& index, int flag) = 0;
/** Set the flags on a hash.
@return `true` if the flags were changed.
*/
// VFALCO TODO Rename to setFlags since it works with multiple flags.
virtual bool setFlag (uint256 const& index, int mask) = 0;
virtual int getFlags (uint256 const& index) = 0;
virtual bool swapSet (uint256 const& index, std::set<PeerShortID>& peers, int flag) = 0;
};
} // ripple
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -101,12 +101,6 @@ public:
// Network information // Network information
// //
// Our best estimate of wall time in seconds from 1/1/2000
virtual std::uint32_t getNetworkTimeNC () const = 0;
// Our best estimate of current ledger close time
virtual std::uint32_t getCloseTimeNC () const = 0;
virtual void closeTimeOffset (int) = 0;
virtual OperatingMode getOperatingMode () const = 0; virtual OperatingMode getOperatingMode () const = 0;
virtual std::string strOperatingMode () const = 0; virtual std::string strOperatingMode () const = 0;
@@ -116,7 +110,7 @@ public:
// //
// must complete immediately // must complete immediately
virtual void submitTransaction (Job&, STTx::pointer) = 0; virtual void submitTransaction (STTx::pointer) = 0;
/** /**
* Process transactions as they arrive from the network or which are * Process transactions as they arrive from the network or which are
@@ -135,7 +129,7 @@ public:
// Owner functions // Owner functions
// //
virtual Json::Value getOwnerInfo (Ledger::pointer lpLedger, virtual Json::Value getOwnerInfo (std::shared_ptr<ReadView const> lpLedger,
AccountID const& account) = 0; AccountID const& account) = 0;
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
@@ -233,15 +227,17 @@ public:
// Monitoring: publisher side // Monitoring: publisher side
// //
virtual void pubLedger (Ledger::ref lpAccepted) = 0; virtual void pubLedger (Ledger::ref lpAccepted) = 0;
virtual void pubProposedTransaction (Ledger::ref lpCurrent, virtual void pubProposedTransaction (
std::shared_ptr<ReadView const> const& lpCurrent,
STTx::ref stTxn, TER terResult) = 0; STTx::ref stTxn, TER terResult) = 0;
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::unique_ptr<NetworkOPs> std::unique_ptr<NetworkOPs>
make_NetworkOPs (NetworkOPs::clock_type& clock, bool standalone, make_NetworkOPs (Application& app, NetworkOPs::clock_type& clock, bool standalone,
std::size_t network_quorum, JobQueue& job_queue, LedgerMaster& ledgerMaster, std::size_t network_quorum, bool start_valid,
JobQueue& job_queue, LedgerMaster& ledgerMaster,
beast::Stoppable& parent, beast::Journal journal); beast::Stoppable& parent, beast::Journal journal);
} // ripple } // ripple

View File

@@ -79,7 +79,9 @@ SHAMapStore::Setup
setup_SHAMapStore(Config const& c); setup_SHAMapStore(Config const& c);
std::unique_ptr<SHAMapStore> std::unique_ptr<SHAMapStore>
make_SHAMapStore(SHAMapStore::Setup const& s, make_SHAMapStore(
Application& app,
SHAMapStore::Setup const& s,
beast::Stoppable& parent, beast::Stoppable& parent,
NodeStore::Scheduler& scheduler, NodeStore::Scheduler& scheduler,
beast::Journal journal, beast::Journal journal,

View File

@@ -160,7 +160,11 @@ SHAMapStoreImp::SavedStateDB::setLastRotated (LedgerIndex seq)
; ;
} }
SHAMapStoreImp::SHAMapStoreImp (Setup const& setup, //------------------------------------------------------------------------------
SHAMapStoreImp::SHAMapStoreImp (
Application& app,
Setup const& setup,
Stoppable& parent, Stoppable& parent,
NodeStore::Scheduler& scheduler, NodeStore::Scheduler& scheduler,
beast::Journal journal, beast::Journal journal,
@@ -168,6 +172,7 @@ SHAMapStoreImp::SHAMapStoreImp (Setup const& setup,
TransactionMaster& transactionMaster, TransactionMaster& transactionMaster,
BasicConfig const& config) BasicConfig const& config)
: SHAMapStore (parent) : SHAMapStore (parent)
, app_ (app)
, setup_ (setup) , setup_ (setup)
, scheduler_ (scheduler) , scheduler_ (scheduler)
, journal_ (journal) , journal_ (journal)
@@ -262,12 +267,12 @@ void
SHAMapStoreImp::run() SHAMapStoreImp::run()
{ {
LedgerIndex lastRotated = state_db_.getState().lastRotated; LedgerIndex lastRotated = state_db_.getState().lastRotated;
netOPs_ = &getApp().getOPs(); netOPs_ = &app_.getOPs();
ledgerMaster_ = &getApp().getLedgerMaster(); ledgerMaster_ = &app_.getLedgerMaster();
fullBelowCache_ = &getApp().family().fullbelow(); fullBelowCache_ = &app_.family().fullbelow();
treeNodeCache_ = &getApp().family().treecache(); treeNodeCache_ = &app_.family().treecache();
transactionDb_ = &getApp().getTxnDB(); transactionDb_ = &app_.getTxnDB();
ledgerDb_ = &getApp().getLedgerDB(); ledgerDb_ = &app_.getLedgerDB();
if (setup_.advisoryDelete) if (setup_.advisoryDelete)
canDelete_ = state_db_.getCanDelete (); canDelete_ = state_db_.getCanDelete ();
@@ -666,25 +671,35 @@ setup_SHAMapStore (Config const& c)
{ {
SHAMapStore::Setup setup; SHAMapStore::Setup setup;
auto const& sec = c.section (ConfigSection::nodeDatabase ()); // Get existing settings and add some default values if not specified:
get_if_exists (sec, "online_delete", setup.deleteInterval); setup.nodeDatabase = c.section (ConfigSection::nodeDatabase ());
// These two parameters apply only to RocksDB. We want to give them sensible
// defaults if no values are specified.
if (!setup.nodeDatabase.exists ("cache_mb"))
setup.nodeDatabase.set ("cache_mb", std::to_string (c.getSize (siHashNodeDBCache)));
if (!setup.nodeDatabase.exists ("filter_bits") && (c.NODE_SIZE >= 2))
setup.nodeDatabase.set ("filter_bits", "10");
get_if_exists (setup.nodeDatabase, "online_delete", setup.deleteInterval);
if (setup.deleteInterval) if (setup.deleteInterval)
get_if_exists (sec, "advisory_delete", setup.advisoryDelete); get_if_exists (setup.nodeDatabase, "advisory_delete", setup.advisoryDelete);
setup.ledgerHistory = c.LEDGER_HISTORY; setup.ledgerHistory = c.LEDGER_HISTORY;
setup.nodeDatabase = c[ConfigSection::nodeDatabase ()];
setup.databasePath = c.legacy("database_path"); setup.databasePath = c.legacy("database_path");
get_if_exists (sec, "delete_batch", setup.deleteBatch); get_if_exists (setup.nodeDatabase, "delete_batch", setup.deleteBatch);
get_if_exists (sec, "backOff", setup.backOff); get_if_exists (setup.nodeDatabase, "backOff", setup.backOff);
get_if_exists (sec, "age_threshold", setup.ageThreshold); get_if_exists (setup.nodeDatabase, "age_threshold", setup.ageThreshold);
return setup; return setup;
} }
std::unique_ptr<SHAMapStore> std::unique_ptr<SHAMapStore>
make_SHAMapStore (SHAMapStore::Setup const& s, make_SHAMapStore (Application& app,
SHAMapStore::Setup const& s,
beast::Stoppable& parent, beast::Stoppable& parent,
NodeStore::Scheduler& scheduler, NodeStore::Scheduler& scheduler,
beast::Journal journal, beast::Journal journal,
@@ -692,7 +707,7 @@ make_SHAMapStore (SHAMapStore::Setup const& s,
TransactionMaster& transactionMaster, TransactionMaster& transactionMaster,
BasicConfig const& config) BasicConfig const& config)
{ {
return std::make_unique<SHAMapStoreImp>(s, parent, scheduler, return std::make_unique<SHAMapStoreImp>(app, s, parent, scheduler,
journal, nodeStoreJournal, transactionMaster, journal, nodeStoreJournal, transactionMaster,
config); config);
} }

View File

@@ -71,6 +71,8 @@ private:
void setLastRotated (LedgerIndex seq); void setLastRotated (LedgerIndex seq);
}; };
Application& app_;
// name of state database // name of state database
std::string const dbName_ = "state"; std::string const dbName_ = "state";
// prefix of on-disk nodestore backend instances // prefix of on-disk nodestore backend instances
@@ -105,7 +107,8 @@ private:
DatabaseCon* ledgerDb_ = nullptr; DatabaseCon* ledgerDb_ = nullptr;
public: public:
SHAMapStoreImp (Setup const& setup, SHAMapStoreImp (Application& app,
Setup const& setup,
Stoppable& parent, Stoppable& parent,
NodeStore::Scheduler& scheduler, NodeStore::Scheduler& scheduler,
beast::Journal journal, beast::Journal journal,

View File

@@ -31,6 +31,7 @@
#include <ripple/basics/Time.h> #include <ripple/basics/Time.h>
#include <ripple/core/Config.h> #include <ripple/core/Config.h>
#include <ripple/core/LoadFeeTrack.h> #include <ripple/core/LoadFeeTrack.h>
#include <ripple/core/TimeKeeper.h>
#include <ripple/crypto/Base58.h> #include <ripple/crypto/Base58.h>
#include <ripple/net/HTTPClient.h> #include <ripple/net/HTTPClient.h>
#include <ripple/protocol/JsonFields.h> #include <ripple/protocol/JsonFields.h>
@@ -160,7 +161,8 @@ void selectBlobsIntoStrings (
} }
} }
// VFALCO TODO move all function definitions inlined into the class. //------------------------------------------------------------------------------
class UniqueNodeListImp class UniqueNodeListImp
: public UniqueNodeList : public UniqueNodeList
, public beast::DeadlineTimer::Listener , public beast::DeadlineTimer::Listener
@@ -201,6 +203,8 @@ private:
}; };
private: private:
Application& app_;
typedef RippleMutex FetchLockType; typedef RippleMutex FetchLockType;
typedef std::lock_guard <FetchLockType> ScopedFetchLockType; typedef std::lock_guard <FetchLockType> ScopedFetchLockType;
FetchLockType mFetchLock; FetchLockType mFetchLock;
@@ -233,8 +237,9 @@ private:
std::string node_file_name_; std::string node_file_name_;
std::string node_file_path_; std::string node_file_path_;
beast::Journal j_;
public: public:
explicit UniqueNodeListImp (Stoppable& parent); UniqueNodeListImp (Application& app, Stoppable& parent);
void onStop(); void onStop();
@@ -361,7 +366,7 @@ private:
// --> strValidatorsSrc: source details for display // --> strValidatorsSrc: source details for display
// --> naNodePublic: remote source public key - not valid for local // --> naNodePublic: remote source public key - not valid for local
// --> vsWhy: reason for adding validator to SeedDomains or SeedNodes. // --> vsWhy: reason for adding validator to SeedDomains or SeedNodes.
int processValidators (std::string const& strSite, std::string const& strValidatorsSrc, RippleAddress const& naNodePublic, ValidatorSource vsWhy, IniFileSections::mapped_type* pmtVecStrValidators); int processValidators (std::string const& strSite, std::string const& strValidatorsSrc, RippleAddress const& naNodePublic, ValidatorSource vsWhy, IniFileSections::mapped_type const* pmtVecStrValidators);
// Process a ripple.txt. // Process a ripple.txt.
void processFile (std::string const& strDomain, RippleAddress const& naNodePublic, IniFileSections secSite); void processFile (std::string const& strDomain, RippleAddress const& naNodePublic, IniFileSections secSite);
@@ -400,11 +405,13 @@ UniqueNodeList::UniqueNodeList (Stoppable& parent)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
UniqueNodeListImp::UniqueNodeListImp (Stoppable& parent) UniqueNodeListImp::UniqueNodeListImp (Application& app, Stoppable& parent)
: UniqueNodeList (parent) : UniqueNodeList (parent)
, app_ (app)
, m_scoreTimer (this) , m_scoreTimer (this)
, mFetchActive (0) , mFetchActive (0)
, m_fetchTimer (this) , m_fetchTimer (this)
, j_ (app.journal ("UniqueNodeList"))
{ {
node_file_name_ = std::string (systemName ()) + ".txt"; node_file_name_ = std::string (systemName ()) + ".txt";
node_file_path_ = "/" + node_file_name_; node_file_path_ = "/" + node_file_name_;
@@ -423,11 +430,11 @@ void UniqueNodeListImp::doScore()
mtpScoreNext = boost::posix_time::ptime (boost::posix_time::not_a_date_time); // Timer not set. mtpScoreNext = boost::posix_time::ptime (boost::posix_time::not_a_date_time); // Timer not set.
mtpScoreStart = boost::posix_time::second_clock::universal_time (); // Scoring. mtpScoreStart = boost::posix_time::second_clock::universal_time (); // Scoring.
WriteLog (lsTRACE, UniqueNodeList) << "Scoring: Start"; JLOG (j_.trace) << "Scoring: Start";
scoreCompute (); scoreCompute ();
WriteLog (lsTRACE, UniqueNodeList) << "Scoring: End"; JLOG (j_.trace) << "Scoring: End";
// Save update time. // Save update time.
mtpScoreUpdated = mtpScoreStart; mtpScoreUpdated = mtpScoreStart;
@@ -442,7 +449,7 @@ void UniqueNodeListImp::doScore()
void UniqueNodeListImp::doFetch() void UniqueNodeListImp::doFetch()
{ {
// Time to check for another fetch. // Time to check for another fetch.
WriteLog (lsTRACE, UniqueNodeList) << "fetchTimerHandler"; JLOG (j_.trace) << "fetchTimerHandler";
fetchNext (); fetchNext ();
} }
@@ -450,13 +457,14 @@ void UniqueNodeListImp::onDeadlineTimer (beast::DeadlineTimer& timer)
{ {
if (timer == m_scoreTimer) if (timer == m_scoreTimer)
{ {
getApp().getJobQueue ().addJob (jtUNL, "UNL.score", app_.getJobQueue ().addJob (
std::bind (&UniqueNodeListImp::doScore, this)); jtUNL, "UNL.score",
[this] (Job&) { doScore(); });
} }
else if (timer == m_fetchTimer) else if (timer == m_fetchTimer)
{ {
getApp().getJobQueue ().addJob (jtUNL, "UNL.fetch", app_.getJobQueue ().addJob (jtUNL, "UNL.fetch",
std::bind (&UniqueNodeListImp::doFetch, this)); [this] (Job&) { doFetch(); });
} }
} }
@@ -466,8 +474,8 @@ void UniqueNodeListImp::start()
{ {
miscLoad (); miscLoad ();
WriteLog (lsDEBUG, UniqueNodeList) << "Validator fetch updated: " << mtpFetchUpdated; JLOG (j_.debug) << "Validator fetch updated: " << mtpFetchUpdated;
WriteLog (lsDEBUG, UniqueNodeList) << "Validator score updated: " << mtpScoreUpdated; JLOG (j_.debug) << "Validator score updated: " << mtpScoreUpdated;
fetchNext (); // Start fetching. fetchNext (); // Start fetching.
scoreNext (false); // Start scoring. scoreNext (false); // Start scoring.
@@ -535,7 +543,7 @@ void UniqueNodeListImp::nodeAddDomain (std::string strDomain, ValidatorSource vs
boost::to_lower (strDomain); boost::to_lower (strDomain);
// YYY Would be best to verify strDomain is a valid domain. // YYY Would be best to verify strDomain is a valid domain.
// WriteLog (lsTRACE) << str(boost::format("nodeAddDomain: '%s' %c '%s'") // JLOG (lsTRACE) << str(boost::format("nodeAddDomain: '%s' %c '%s'")
// % strDomain // % strDomain
// % vsWhy // % vsWhy
// % strComment); // % strComment);
@@ -575,7 +583,7 @@ void UniqueNodeListImp::nodeAddDomain (std::string strDomain, ValidatorSource vs
void UniqueNodeListImp::nodeRemovePublic (RippleAddress const& naNodePublic) void UniqueNodeListImp::nodeRemovePublic (RippleAddress const& naNodePublic)
{ {
{ {
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
*db << str ( *db << str (
boost::format ("DELETE FROM SeedNodes WHERE PublicKey=%s;") % boost::format ("DELETE FROM SeedNodes WHERE PublicKey=%s;") %
@@ -600,7 +608,7 @@ void UniqueNodeListImp::nodeRemoveDomain (std::string strDomain)
boost::to_lower (strDomain); boost::to_lower (strDomain);
{ {
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
*db << str (boost::format ("DELETE FROM SeedDomains WHERE Domain=%s;") % sqlEscape (strDomain)); *db << str (boost::format ("DELETE FROM SeedDomains WHERE Domain=%s;") % sqlEscape (strDomain));
} }
@@ -614,7 +622,7 @@ void UniqueNodeListImp::nodeRemoveDomain (std::string strDomain)
void UniqueNodeListImp::nodeReset() void UniqueNodeListImp::nodeReset()
{ {
{ {
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
*db << "DELETE FROM SeedDomains;"; *db << "DELETE FROM SeedDomains;";
*db << "DELETE FROM SeedNodes;"; *db << "DELETE FROM SeedNodes;";
@@ -695,7 +703,7 @@ UniqueNodeListImp::getClusterStatus()
std::uint32_t UniqueNodeListImp::getClusterFee() std::uint32_t UniqueNodeListImp::getClusterFee()
{ {
int thresh = getApp().getOPs().getNetworkTimeNC() - 90; auto const thresh = app_.timeKeeper().now().time_since_epoch().count() - 90;
std::vector<std::uint32_t> fees; std::vector<std::uint32_t> fees;
{ {
@@ -723,14 +731,14 @@ void UniqueNodeListImp::addClusterStatus (Json::Value& obj)
ScopedUNLLockType sl (mUNLLock); ScopedUNLLockType sl (mUNLLock);
if (m_clusterNodes.size() > 1) // nodes other than us if (m_clusterNodes.size() > 1) // nodes other than us
{ {
int now = getApp().getOPs().getNetworkTimeNC(); auto const now = app_.timeKeeper().now().time_since_epoch().count();
std::uint32_t ref = getApp().getFeeTrack().getLoadBase(); std::uint32_t ref = app_.getFeeTrack().getLoadBase();
Json::Value& nodes = (obj[jss::cluster] = Json::objectValue); Json::Value& nodes = (obj[jss::cluster] = Json::objectValue);
for (std::map<RippleAddress, ClusterNodeStatus>::iterator it = m_clusterNodes.begin(), for (std::map<RippleAddress, ClusterNodeStatus>::iterator it = m_clusterNodes.begin(),
end = m_clusterNodes.end(); it != end; ++it) end = m_clusterNodes.end(); it != end; ++it)
{ {
if (it->first != getApp().getLocalCredentials().getNodePublic()) if (it->first != app_.getLocalCredentials().getNodePublic())
{ {
Json::Value& node = nodes[it->first.humanNodePublic()]; Json::Value& node = nodes[it->first.humanNodePublic()];
@@ -756,8 +764,8 @@ void UniqueNodeListImp::nodeBootstrap()
#if 0 #if 0
{ {
auto sl (getApp().getWalletDB ().lock ()); auto sl (app_.getWalletDB ().lock ());
auto db = getApp().getWalletDB ().getDB (); auto db = app_.getWalletDB ().getDB ();
if (db->executeSQL (str (boost::format ("SELECT COUNT(*) AS Count FROM SeedDomains WHERE Source='%s' OR Source='%c';") % vsManual % vsValidator)) && db->startIterRows ()) if (db->executeSQL (str (boost::format ("SELECT COUNT(*) AS Count FROM SeedDomains WHERE Source='%s' OR Source='%c';") % vsManual % vsValidator)) && db->startIterRows ())
iDomains = db->getInt ("Count"); iDomains = db->getInt ("Count");
@@ -774,38 +782,40 @@ void UniqueNodeListImp::nodeBootstrap()
bool bLoaded = iDomains || iNodes; bool bLoaded = iDomains || iNodes;
// Always merge in the file specified in the config. // Always merge in the file specified in the config.
if (!getConfig ().VALIDATORS_FILE.empty ()) if (!app_.config().VALIDATORS_FILE.empty ())
{ {
WriteLog (lsINFO, UniqueNodeList) << "Bootstrapping UNL: loading from unl_default."; JLOG (j_.info) << "Bootstrapping UNL: loading from unl_default.";
bLoaded = nodeLoad (getConfig ().VALIDATORS_FILE); bLoaded = nodeLoad (app_.config().VALIDATORS_FILE);
} }
// If never loaded anything try the current directory. // If never loaded anything try the current directory.
if (!bLoaded && getConfig ().VALIDATORS_FILE.empty ()) if (!bLoaded && app_.config().VALIDATORS_FILE.empty ())
{ {
WriteLog (lsINFO, UniqueNodeList) << boost::str (boost::format ("Bootstrapping UNL: loading from '%s'.") JLOG (j_.info) << boost::str (boost::format ("Bootstrapping UNL: loading from '%s'.")
% getConfig ().VALIDATORS_BASE); % app_.config().VALIDATORS_BASE);
bLoaded = nodeLoad (getConfig ().VALIDATORS_BASE); bLoaded = nodeLoad (app_.config().VALIDATORS_BASE);
} }
// Always load from rippled.cfg // Always load from rippled.cfg
if (!getConfig ().validators.empty ()) if (!app_.config().validators.empty ())
{ {
RippleAddress naInvalid; // Don't want a referrer on added entries. RippleAddress naInvalid; // Don't want a referrer on added entries.
WriteLog (lsINFO, UniqueNodeList) << boost::str (boost::format ("Bootstrapping UNL: loading from '%s'.") JLOG (j_.info) << boost::str (boost::format ("Bootstrapping UNL: loading from '%s'.")
% getConfig ().CONFIG_FILE); % app_.config().CONFIG_FILE);
if (processValidators ("local", getConfig ().CONFIG_FILE.string (), naInvalid, vsConfig, &getConfig ().validators)) if (processValidators ("local",
app_.config().CONFIG_FILE.string (), naInvalid,
vsConfig, &(app_.config().validators)))
bLoaded = true; bLoaded = true;
} }
if (!bLoaded) if (!bLoaded)
{ {
WriteLog (lsINFO, UniqueNodeList) << boost::str (boost::format ("Bootstrapping UNL: loading from '%s'.") JLOG (j_.info) << boost::str (boost::format ("Bootstrapping UNL: loading from '%s'.")
% getConfig ().VALIDATORS_SITE); % app_.config().VALIDATORS_SITE);
nodeNetwork (); nodeNetwork ();
} }
@@ -817,7 +827,7 @@ bool UniqueNodeListImp::nodeLoad (boost::filesystem::path pConfig)
{ {
if (pConfig.empty ()) if (pConfig.empty ())
{ {
WriteLog (lsINFO, UniqueNodeList) << Config::Helpers::getValidatorsFileName() << JLOG (j_.info) << Config::Helpers::getValidatorsFileName() <<
" path not specified."; " path not specified.";
return false; return false;
@@ -825,7 +835,7 @@ bool UniqueNodeListImp::nodeLoad (boost::filesystem::path pConfig)
if (!boost::filesystem::exists (pConfig)) if (!boost::filesystem::exists (pConfig))
{ {
WriteLog (lsWARNING, UniqueNodeList) << Config::Helpers::getValidatorsFileName() << JLOG (j_.warning) << Config::Helpers::getValidatorsFileName() <<
" not found: " << pConfig; " not found: " << pConfig;
return false; return false;
@@ -833,7 +843,7 @@ bool UniqueNodeListImp::nodeLoad (boost::filesystem::path pConfig)
if (!boost::filesystem::is_regular_file (pConfig)) if (!boost::filesystem::is_regular_file (pConfig))
{ {
WriteLog (lsWARNING, UniqueNodeList) << Config::Helpers::getValidatorsFileName() << JLOG (j_.warning) << Config::Helpers::getValidatorsFileName() <<
" not regular file: " << pConfig; " not regular file: " << pConfig;
return false; return false;
@@ -843,7 +853,7 @@ bool UniqueNodeListImp::nodeLoad (boost::filesystem::path pConfig)
if (!ifsDefault) if (!ifsDefault)
{ {
WriteLog (lsFATAL, UniqueNodeList) << Config::Helpers::getValidatorsFileName() << JLOG (j_.fatal) << Config::Helpers::getValidatorsFileName() <<
" failed to open: " << pConfig; " failed to open: " << pConfig;
return false; return false;
@@ -856,7 +866,7 @@ bool UniqueNodeListImp::nodeLoad (boost::filesystem::path pConfig)
if (ifsDefault.bad ()) if (ifsDefault.bad ())
{ {
WriteLog (lsFATAL, UniqueNodeList) << Config::Helpers::getValidatorsFileName() << JLOG (j_.fatal) << Config::Helpers::getValidatorsFileName() <<
"Failed to read: " << pConfig; "Failed to read: " << pConfig;
return false; return false;
@@ -864,7 +874,7 @@ bool UniqueNodeListImp::nodeLoad (boost::filesystem::path pConfig)
nodeProcess ("local", strValidators, pConfig.string ()); nodeProcess ("local", strValidators, pConfig.string ());
WriteLog (lsTRACE, UniqueNodeList) << str (boost::format ("Processing: %s") % pConfig); JLOG (j_.trace) << str (boost::format ("Processing: %s") % pConfig);
return true; return true;
} }
@@ -873,20 +883,21 @@ bool UniqueNodeListImp::nodeLoad (boost::filesystem::path pConfig)
void UniqueNodeListImp::nodeNetwork() void UniqueNodeListImp::nodeNetwork()
{ {
if (!getConfig ().VALIDATORS_SITE.empty ()) if (!app_.config().VALIDATORS_SITE.empty ())
{ {
HTTPClient::get ( HTTPClient::get (
true, true,
getApp().getIOService (), app_.getIOService (),
getConfig ().VALIDATORS_SITE, app_.config().VALIDATORS_SITE,
443, 443,
getConfig ().VALIDATORS_URI, app_.config().VALIDATORS_URI,
VALIDATORS_FILE_BYTES_MAX, VALIDATORS_FILE_BYTES_MAX,
boost::posix_time::seconds (VALIDATORS_FETCH_SECONDS), boost::posix_time::seconds (VALIDATORS_FETCH_SECONDS),
std::bind (&UniqueNodeListImp::validatorsResponse, this, std::bind (&UniqueNodeListImp::validatorsResponse, this,
std::placeholders::_1, std::placeholders::_1,
std::placeholders::_2, std::placeholders::_2,
std::placeholders::_3)); std::placeholders::_3),
app_.logs());
} }
} }
@@ -897,7 +908,7 @@ Json::Value UniqueNodeListImp::getUnlJson()
Json::Value ret (Json::arrayValue); Json::Value ret (Json::arrayValue);
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
std::vector<std::array<boost::optional<std::string>, 2>> columns; std::vector<std::array<boost::optional<std::string>, 2>> columns;
@@ -976,7 +987,7 @@ int UniqueNodeListImp::iSourceScore (ValidatorSource vsWhy)
// Load information about when we last updated. // Load information about when we last updated.
bool UniqueNodeListImp::miscLoad() bool UniqueNodeListImp::miscLoad()
{ {
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
boost::optional<int> suO, fuO; boost::optional<int> suO, fuO;
@@ -997,7 +1008,7 @@ bool UniqueNodeListImp::miscLoad()
// Persist update information. // Persist update information.
bool UniqueNodeListImp::miscSave() bool UniqueNodeListImp::miscSave()
{ {
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
*db << str (boost::format ("REPLACE INTO Misc (Magic,FetchUpdated,ScoreUpdated) VALUES (1,%d,%d);") *db << str (boost::format ("REPLACE INTO Misc (Magic,FetchUpdated,ScoreUpdated) VALUES (1,%d,%d);")
% iToSeconds (mtpFetchUpdated) % iToSeconds (mtpFetchUpdated)
@@ -1011,7 +1022,7 @@ bool UniqueNodeListImp::miscSave()
void UniqueNodeListImp::trustedLoad() void UniqueNodeListImp::trustedLoad()
{ {
boost::regex rNode ("\\`\\s*(\\S+)[\\s]*(.*)\\'"); boost::regex rNode ("\\`\\s*(\\S+)[\\s]*(.*)\\'");
for (auto const& c : getConfig ().CLUSTER_NODES) for (auto const& c : app_.config().CLUSTER_NODES)
{ {
boost::smatch match; boost::smatch match;
@@ -1023,10 +1034,10 @@ void UniqueNodeListImp::trustedLoad()
m_clusterNodes.insert (std::make_pair (a, ClusterNodeStatus(match[2]))); m_clusterNodes.insert (std::make_pair (a, ClusterNodeStatus(match[2])));
} }
else else
WriteLog (lsWARNING, UniqueNodeList) << "Entry in cluster list invalid: '" << c << "'"; JLOG (j_.warning) << "Entry in cluster list invalid: '" << c << "'";
} }
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
ScopedUNLLockType slUNL (mUNLLock); ScopedUNLLockType slUNL (mUNLLock);
mUNL.clear (); mUNL.clear ();
@@ -1073,10 +1084,10 @@ bool UniqueNodeListImp::scoreRound (std::vector<scoreNode>& vsnNodes)
if (ShouldLog (lsTRACE, UniqueNodeList)) if (ShouldLog (lsTRACE, UniqueNodeList))
{ {
WriteLog (lsTRACE, UniqueNodeList) << "midway: "; JLOG (j_.trace) << "midway: ";
for (auto& sn : vsnNodes) for (auto& sn : vsnNodes)
{ {
WriteLog (lsTRACE, UniqueNodeList) << str (boost::format ("%s| %d, %d, %d: [%s]") JLOG (j_.trace) << str (boost::format ("%s| %d, %d, %d: [%s]")
% sn.strValidator % sn.strValidator
% sn.iScore % sn.iScore
% sn.iRoundScore % sn.iRoundScore
@@ -1099,10 +1110,10 @@ bool UniqueNodeListImp::scoreRound (std::vector<scoreNode>& vsnNodes)
if (ShouldLog (lsTRACE, UniqueNodeList)) if (ShouldLog (lsTRACE, UniqueNodeList))
{ {
WriteLog (lsTRACE, UniqueNodeList) << "finish: "; JLOG (j_.trace) << "finish: ";
for (auto& sn : vsnNodes) for (auto& sn : vsnNodes)
{ {
WriteLog (lsTRACE, UniqueNodeList) << str (boost::format ("%s| %d, %d, %d: [%s]") JLOG (j_.trace) << str (boost::format ("%s| %d, %d, %d: [%s]")
% sn.strValidator % sn.strValidator
% sn.iScore % sn.iScore
% sn.iRoundScore % sn.iRoundScore
@@ -1129,7 +1140,7 @@ void UniqueNodeListImp::scoreCompute()
// For each entry in SeedDomains with a PublicKey: // For each entry in SeedDomains with a PublicKey:
// - Add an entry in umPulicIdx, umDomainIdx, and vsnNodes. // - Add an entry in umPulicIdx, umDomainIdx, and vsnNodes.
{ {
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
std::vector<std::array<boost::optional<std::string>, 3>> columns; std::vector<std::array<boost::optional<std::string>, 3>> columns;
selectBlobsIntoStrings(*db, selectBlobsIntoStrings(*db,
@@ -1186,7 +1197,7 @@ void UniqueNodeListImp::scoreCompute()
// For each entry in SeedNodes: // For each entry in SeedNodes:
// - Add an entry in umPulicIdx, umDomainIdx, and vsnNodes. // - Add an entry in umPulicIdx, umDomainIdx, and vsnNodes.
{ {
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
std::vector<std::array<boost::optional<std::string>, 2>> columns; std::vector<std::array<boost::optional<std::string>, 2>> columns;
selectBlobsIntoStrings(*db, selectBlobsIntoStrings(*db,
@@ -1237,7 +1248,7 @@ void UniqueNodeListImp::scoreCompute()
{ {
for (auto& sn : vsnNodes) for (auto& sn : vsnNodes)
{ {
WriteLog (lsTRACE, UniqueNodeList) << str (boost::format ("%s| %d, %d, %d") JLOG (j_.trace) << str (boost::format ("%s| %d, %d, %d")
% sn.strValidator % sn.strValidator
% sn.iScore % sn.iScore
% sn.iRoundScore % sn.iRoundScore
@@ -1245,7 +1256,7 @@ void UniqueNodeListImp::scoreCompute()
} }
} }
// WriteLog (lsTRACE, UniqueNodeList) << str(boost::format("vsnNodes.size=%d") % vsnNodes.size()); // JLOG (j_.trace) << str(boost::format("vsnNodes.size=%d") % vsnNodes.size());
// Step through growing list of nodes adding each validation list. // Step through growing list of nodes adding each validation list.
// - Each validator may have provided referals. Add those referals as validators. // - Each validator may have provided referals. Add those referals as validators.
@@ -1255,7 +1266,7 @@ void UniqueNodeListImp::scoreCompute()
std::string& strValidator = sn.strValidator; std::string& strValidator = sn.strValidator;
std::vector<int>& viReferrals = sn.viReferrals; std::vector<int>& viReferrals = sn.viReferrals;
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
std::vector<std::array<boost::optional<std::string>, 1>> columns; std::vector<std::array<boost::optional<std::string>, 1>> columns;
selectBlobsIntoStrings(*db, selectBlobsIntoStrings(*db,
@@ -1324,10 +1335,10 @@ void UniqueNodeListImp::scoreCompute()
if (ShouldLog (lsTRACE, UniqueNodeList)) if (ShouldLog (lsTRACE, UniqueNodeList))
{ {
WriteLog (lsTRACE, UniqueNodeList) << "Scored:"; JLOG (j_.trace) << "Scored:";
for (auto& sn : vsnNodes) for (auto& sn : vsnNodes)
{ {
WriteLog (lsTRACE, UniqueNodeList) << str (boost::format ("%s| %d, %d, %d: [%s]") JLOG (j_.trace) << str (boost::format ("%s| %d, %d, %d: [%s]")
% sn.strValidator % sn.strValidator
% sn.iScore % sn.iScore
% sn.iRoundScore % sn.iRoundScore
@@ -1337,7 +1348,7 @@ void UniqueNodeListImp::scoreCompute()
} }
// Persist validator scores. // Persist validator scores.
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
soci::transaction tr(*db); soci::transaction tr(*db);
*db << "UPDATE TrustedNodes SET Score = 0 WHERE Score != 0;"; *db << "UPDATE TrustedNodes SET Score = 0 WHERE Score != 0;";
@@ -1425,7 +1436,7 @@ void UniqueNodeListImp::scoreCompute()
{ {
umValidators[get<0>(col).value_or("")] = get<1>(col).value_or(0); umValidators[get<0>(col).value_or("")] = get<1>(col).value_or(0);
// WriteLog (lsTRACE, UniqueNodeList) << strValidator << ":" << db->getInt("Count"); // JLOG (j_.trace) << strValidator << ":" << db->getInt("Count");
} }
} }
@@ -1482,7 +1493,7 @@ void UniqueNodeListImp::scoreCompute()
// <-- bNow: true, to force scoring for debugging. // <-- bNow: true, to force scoring for debugging.
void UniqueNodeListImp::scoreNext (bool bNow) void UniqueNodeListImp::scoreNext (bool bNow)
{ {
// WriteLog (lsTRACE, UniqueNodeList) << str(boost::format("scoreNext: mtpFetchUpdated=%s mtpScoreStart=%s mtpScoreUpdated=%s mtpScoreNext=%s") % mtpFetchUpdated % mtpScoreStart % mtpScoreUpdated % mtpScoreNext); // JLOG (j_.trace) << str(boost::format("scoreNext: mtpFetchUpdated=%s mtpScoreStart=%s mtpScoreUpdated=%s mtpScoreNext=%s") % mtpFetchUpdated % mtpScoreStart % mtpScoreUpdated % mtpScoreNext);
bool bCanScore = mtpScoreStart.is_not_a_date_time () // Not scoring. bool bCanScore = mtpScoreStart.is_not_a_date_time () // Not scoring.
&& !mtpFetchUpdated.is_not_a_date_time (); // Something to score. && !mtpFetchUpdated.is_not_a_date_time (); // Something to score.
@@ -1498,7 +1509,7 @@ void UniqueNodeListImp::scoreNext (bool bNow)
mtpScoreNext = boost::posix_time::second_clock::universal_time () // Past now too. mtpScoreNext = boost::posix_time::second_clock::universal_time () // Past now too.
+ boost::posix_time::seconds (secondsFromNow); + boost::posix_time::seconds (secondsFromNow);
// WriteLog (lsTRACE, UniqueNodeList) << str(boost::format("scoreNext: @%s") % mtpScoreNext); // JLOG (j_.trace) << str(boost::format("scoreNext: @%s") % mtpScoreNext);
m_scoreTimer.setExpiration (secondsFromNow); m_scoreTimer.setExpiration (secondsFromNow);
} }
} }
@@ -1520,12 +1531,12 @@ bool UniqueNodeListImp::responseFetch (std::string const& strDomain, const boost
if (bGood) if (bGood)
{ {
WriteLog (lsTRACE, UniqueNodeList) << strDomain JLOG (j_.trace) << strDomain
<< ": retrieved configuration"; << ": retrieved configuration";
} }
else else
{ {
WriteLog (lsTRACE, UniqueNodeList) << strDomain JLOG (j_.trace) << strDomain
<< ": unable to retrieve configuration: " << ": unable to retrieve configuration: "
<< err.message (); << err.message ();
} }
@@ -1535,11 +1546,11 @@ bool UniqueNodeListImp::responseFetch (std::string const& strDomain, const boost
// //
std::string strSite; std::string strSite;
if (bGood && !getSingleSection (secSite, SECTION_DOMAIN, strSite)) if (bGood && !getSingleSection (secSite, SECTION_DOMAIN, strSite, j_))
{ {
bGood = false; bGood = false;
WriteLog (lsTRACE, UniqueNodeList) << strDomain JLOG (j_.trace) << strDomain
<< ": " << SECTION_DOMAIN << ": " << SECTION_DOMAIN
<< "entry missing."; << "entry missing.";
} }
@@ -1548,7 +1559,7 @@ bool UniqueNodeListImp::responseFetch (std::string const& strDomain, const boost
{ {
bGood = false; bGood = false;
WriteLog (lsTRACE, UniqueNodeList) << strDomain JLOG (j_.trace) << strDomain
<< ": " << SECTION_DOMAIN << " does not match " << strSite; << ": " << SECTION_DOMAIN << " does not match " << strSite;
} }
@@ -1557,12 +1568,12 @@ bool UniqueNodeListImp::responseFetch (std::string const& strDomain, const boost
// //
std::string strNodePublicKey; std::string strNodePublicKey;
if (bGood && !getSingleSection (secSite, SECTION_PUBLIC_KEY, strNodePublicKey)) if (bGood && !getSingleSection (secSite, SECTION_PUBLIC_KEY, strNodePublicKey, j_))
{ {
// Bad [validation_public_key] IniFileSections. // Bad [validation_public_key] IniFileSections.
bGood = false; bGood = false;
WriteLog (lsTRACE, UniqueNodeList) << strDomain JLOG (j_.trace) << strDomain
<< ": " << SECTION_PUBLIC_KEY << " entry missing."; << ": " << SECTION_PUBLIC_KEY << " entry missing.";
} }
@@ -1573,7 +1584,7 @@ bool UniqueNodeListImp::responseFetch (std::string const& strDomain, const boost
// Bad public key. // Bad public key.
bGood = false; bGood = false;
WriteLog (lsTRACE, UniqueNodeList) << strDomain JLOG (j_.trace) << strDomain
<< ": " << SECTION_PUBLIC_KEY << " is not a public key: " << ": " << SECTION_PUBLIC_KEY << " is not a public key: "
<< strNodePublicKey; << strNodePublicKey;
} }
@@ -1596,7 +1607,7 @@ bool UniqueNodeListImp::responseFetch (std::string const& strDomain, const boost
// XXX Only if no other refs to keep it arround, other wise we have an attack vector. // XXX Only if no other refs to keep it arround, other wise we have an attack vector.
sdCurrent.naPublicKey = naNodePublic; sdCurrent.naPublicKey = naNodePublic;
// WriteLog (lsTRACE, UniqueNodeList) << boost::format("sdCurrent.naPublicKey: '%s'") % sdCurrent.naPublicKey.humanNodePublic(); // JLOG (j_.trace) << boost::format("sdCurrent.naPublicKey: '%s'") % sdCurrent.naPublicKey.humanNodePublic();
sdCurrent.tpFetch = boost::posix_time::second_clock::universal_time (); sdCurrent.tpFetch = boost::posix_time::second_clock::universal_time ();
sdCurrent.iSha256 = iSha256; sdCurrent.iSha256 = iSha256;
@@ -1605,13 +1616,13 @@ bool UniqueNodeListImp::responseFetch (std::string const& strDomain, const boost
if (bChangedB) if (bChangedB)
{ {
WriteLog (lsTRACE, UniqueNodeList) << strDomain JLOG (j_.trace) << strDomain
<< ": processing new " << node_file_name_ << "."; << ": processing new " << node_file_name_ << ".";
processFile (strDomain, naNodePublic, secSite); processFile (strDomain, naNodePublic, secSite);
} }
else else
{ {
WriteLog (lsTRACE, UniqueNodeList) << strDomain JLOG (j_.trace) << strDomain
<< ": no change in " << node_file_name_ << "."; << ": no change in " << node_file_name_ << ".";
fetchFinish (); fetchFinish ();
} }
@@ -1648,7 +1659,7 @@ void UniqueNodeListImp::fetchNext()
boost::posix_time::ptime tpNext (boost::posix_time::min_date_time); boost::posix_time::ptime tpNext (boost::posix_time::min_date_time);
boost::posix_time::ptime tpNow (boost::posix_time::second_clock::universal_time ()); boost::posix_time::ptime tpNow (boost::posix_time::second_clock::universal_time ());
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
{ {
@@ -1664,7 +1675,7 @@ void UniqueNodeListImp::fetchNext()
tpNext = ptFromSeconds (iNext); tpNext = ptFromSeconds (iNext);
WriteLog (lsTRACE, UniqueNodeList) << str (boost::format ("fetchNext: iNext=%s tpNext=%s tpNow=%s") % iNext % tpNext % tpNow); JLOG (j_.trace) << str (boost::format ("fetchNext: iNext=%s tpNext=%s tpNow=%s") % iNext % tpNext % tpNow);
if (soci::i_ok == ind) if (soci::i_ok == ind)
convert (b, strDomain); convert (b, strDomain);
else else
@@ -1686,11 +1697,11 @@ void UniqueNodeListImp::fetchNext()
if (strDomain.empty () || bFull) if (strDomain.empty () || bFull)
{ {
WriteLog (lsTRACE, UniqueNodeList) << str (boost::format ("fetchNext: strDomain=%s bFull=%d") % strDomain % bFull); JLOG (j_.trace) << str (boost::format ("fetchNext: strDomain=%s bFull=%d") % strDomain % bFull);
} }
else if (tpNext > tpNow) else if (tpNext > tpNow)
{ {
WriteLog (lsTRACE, UniqueNodeList) << str (boost::format ("fetchNext: set timer : strDomain=%s") % strDomain); JLOG (j_.trace) << str (boost::format ("fetchNext: set timer : strDomain=%s") % strDomain);
// Fetch needs to happen in the future. Set a timer to wake us. // Fetch needs to happen in the future. Set a timer to wake us.
mtpFetchNext = tpNext; mtpFetchNext = tpNext;
@@ -1704,7 +1715,7 @@ void UniqueNodeListImp::fetchNext()
} }
else else
{ {
WriteLog (lsTRACE, UniqueNodeList) << str (boost::format ("fetchNext: fetch now: strDomain=%s tpNext=%s tpNow=%s") % strDomain % tpNext % tpNow); JLOG (j_.trace) << str (boost::format ("fetchNext: fetch now: strDomain=%s tpNext=%s tpNow=%s") % strDomain % tpNext % tpNow);
// Fetch needs to happen now. // Fetch needs to happen now.
mtpFetchNext = boost::posix_time::ptime (boost::posix_time::not_a_date_time); mtpFetchNext = boost::posix_time::ptime (boost::posix_time::not_a_date_time);
@@ -1721,7 +1732,7 @@ void UniqueNodeListImp::fetchNext()
setSeedDomains (sdCurrent, false); setSeedDomains (sdCurrent, false);
WriteLog (lsTRACE, UniqueNodeList) << strDomain JLOG (j_.trace) << strDomain
<< " fetching " << node_file_name_ << "."; << " fetching " << node_file_name_ << ".";
fetchProcess (strDomain); // Go get it. fetchProcess (strDomain); // Go get it.
@@ -1762,7 +1773,7 @@ void UniqueNodeListImp::fetchFinish()
// Get the ripple.txt and process it. // Get the ripple.txt and process it.
void UniqueNodeListImp::fetchProcess (std::string strDomain) void UniqueNodeListImp::fetchProcess (std::string strDomain)
{ {
WriteLog (lsTRACE, UniqueNodeList) << strDomain JLOG (j_.trace) << strDomain
<< ": fetching " << node_file_name_ << "."; << ": fetching " << node_file_name_ << ".";
std::deque<std::string> deqSites; std::deque<std::string> deqSites;
@@ -1775,7 +1786,7 @@ void UniqueNodeListImp::fetchProcess (std::string strDomain)
HTTPClient::get ( HTTPClient::get (
true, true,
getApp().getIOService (), app_.getIOService (),
deqSites, deqSites,
443, 443,
node_file_path_, node_file_path_,
@@ -1783,7 +1794,8 @@ void UniqueNodeListImp::fetchProcess (std::string strDomain)
boost::posix_time::seconds (NODE_FETCH_SECONDS), boost::posix_time::seconds (NODE_FETCH_SECONDS),
std::bind (&UniqueNodeListImp::responseFetch, this, strDomain, std::bind (&UniqueNodeListImp::responseFetch, this, strDomain,
std::placeholders::_1, std::placeholders::_2, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3)); std::placeholders::_3),
app_.logs ());
} }
// Process IniFileSections [validators_url]. // Process IniFileSections [validators_url].
@@ -1796,7 +1808,7 @@ void UniqueNodeListImp::getValidatorsUrl (RippleAddress const& naNodePublic,
int iPort; int iPort;
std::string strPath; std::string strPath;
if (getSingleSection (secSite, SECTION_VALIDATORS_URL, strValidatorsUrl) if (getSingleSection (secSite, SECTION_VALIDATORS_URL, strValidatorsUrl, j_)
&& !strValidatorsUrl.empty () && !strValidatorsUrl.empty ()
&& parseUrl (strValidatorsUrl, strScheme, strDomain, iPort, strPath) && parseUrl (strValidatorsUrl, strScheme, strDomain, iPort, strPath)
&& -1 == iPort && -1 == iPort
@@ -1804,7 +1816,7 @@ void UniqueNodeListImp::getValidatorsUrl (RippleAddress const& naNodePublic,
{ {
HTTPClient::get ( HTTPClient::get (
true, true,
getApp().getIOService (), app_.getIOService (),
strDomain, strDomain,
443, 443,
strPath, strPath,
@@ -1813,7 +1825,8 @@ void UniqueNodeListImp::getValidatorsUrl (RippleAddress const& naNodePublic,
std::bind (&UniqueNodeListImp::responseValidators, this, std::bind (&UniqueNodeListImp::responseValidators, this,
strValidatorsUrl, naNodePublic, secSite, strDomain, strValidatorsUrl, naNodePublic, secSite, strDomain,
std::placeholders::_1, std::placeholders::_2, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3)); std::placeholders::_3),
app_.logs ());
} }
else else
{ {
@@ -1833,7 +1846,7 @@ void UniqueNodeListImp::getIpsUrl (RippleAddress const& naNodePublic, IniFileSec
int iPort; int iPort;
std::string strPath; std::string strPath;
if (getSingleSection (secSite, SECTION_IPS_URL, strIpsUrl) if (getSingleSection (secSite, SECTION_IPS_URL, strIpsUrl, j_)
&& !strIpsUrl.empty () && !strIpsUrl.empty ()
&& parseUrl (strIpsUrl, strScheme, strDomain, iPort, strPath) && parseUrl (strIpsUrl, strScheme, strDomain, iPort, strPath)
&& -1 == iPort && -1 == iPort
@@ -1841,7 +1854,7 @@ void UniqueNodeListImp::getIpsUrl (RippleAddress const& naNodePublic, IniFileSec
{ {
HTTPClient::get ( HTTPClient::get (
true, true,
getApp().getIOService (), app_.getIOService (),
strDomain, strDomain,
443, 443,
strPath, strPath,
@@ -1849,7 +1862,8 @@ void UniqueNodeListImp::getIpsUrl (RippleAddress const& naNodePublic, IniFileSec
boost::posix_time::seconds (NODE_FETCH_SECONDS), boost::posix_time::seconds (NODE_FETCH_SECONDS),
std::bind (&UniqueNodeListImp::responseIps, this, strDomain, std::bind (&UniqueNodeListImp::responseIps, this, strDomain,
naNodePublic, std::placeholders::_1, naNodePublic, std::placeholders::_1,
std::placeholders::_2, std::placeholders::_3)); std::placeholders::_2, std::placeholders::_3),
app_.logs ());
} }
else else
{ {
@@ -1910,13 +1924,13 @@ void UniqueNodeListImp::processIps (std::string const& strSite, RippleAddress co
{ {
std::string strEscNodePublic = sqlEscape (naNodePublic.humanNodePublic ()); std::string strEscNodePublic = sqlEscape (naNodePublic.humanNodePublic ());
WriteLog (lsDEBUG, UniqueNodeList) JLOG (j_.debug)
<< str (boost::format ("Validator: '%s' processing %d ips.") << str (boost::format ("Validator: '%s' processing %d ips.")
% strSite % ( pmtVecStrIps ? pmtVecStrIps->size () : 0)); % strSite % ( pmtVecStrIps ? pmtVecStrIps->size () : 0));
// Remove all current Validator's entries in IpReferrals // Remove all current Validator's entries in IpReferrals
{ {
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
*db << str (boost::format ("DELETE FROM IpReferrals WHERE Validator=%s;") % strEscNodePublic); *db << str (boost::format ("DELETE FROM IpReferrals WHERE Validator=%s;") % strEscNodePublic);
} }
@@ -1948,7 +1962,7 @@ void UniqueNodeListImp::processIps (std::string const& strSite, RippleAddress co
} }
else else
{ {
WriteLog (lsTRACE, UniqueNodeList) JLOG (j_.trace)
<< str (boost::format ("Validator: '%s' [" SECTION_IPS "]: rejecting '%s'") << str (boost::format ("Validator: '%s' [" SECTION_IPS "]: rejecting '%s'")
% strSite % strReferral); % strSite % strReferral);
} }
@@ -1958,7 +1972,7 @@ void UniqueNodeListImp::processIps (std::string const& strSite, RippleAddress co
{ {
vstrValues.resize (iValues); vstrValues.resize (iValues);
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
*db << str (boost::format ("INSERT INTO IpReferrals (Validator,Entry,IP,Port) VALUES %s;") *db << str (boost::format ("INSERT INTO IpReferrals (Validator,Entry,IP,Port) VALUES %s;")
% strJoin (vstrValues.begin (), vstrValues.end (), ",")); % strJoin (vstrValues.begin (), vstrValues.end (), ","));
// XXX Check result. // XXX Check result.
@@ -1975,12 +1989,12 @@ void UniqueNodeListImp::processIps (std::string const& strSite, RippleAddress co
// --> strValidatorsSrc: source details for display // --> strValidatorsSrc: source details for display
// --> naNodePublic: remote source public key - not valid for local // --> naNodePublic: remote source public key - not valid for local
// --> vsWhy: reason for adding validator to SeedDomains or SeedNodes. // --> vsWhy: reason for adding validator to SeedDomains or SeedNodes.
int UniqueNodeListImp::processValidators (std::string const& strSite, std::string const& strValidatorsSrc, RippleAddress const& naNodePublic, ValidatorSource vsWhy, IniFileSections::mapped_type* pmtVecStrValidators) int UniqueNodeListImp::processValidators (std::string const& strSite, std::string const& strValidatorsSrc, RippleAddress const& naNodePublic, ValidatorSource vsWhy, IniFileSections::mapped_type const* pmtVecStrValidators)
{ {
std::string strNodePublic = naNodePublic.isValid () ? naNodePublic.humanNodePublic () : strValidatorsSrc; std::string strNodePublic = naNodePublic.isValid () ? naNodePublic.humanNodePublic () : strValidatorsSrc;
int iValues = 0; int iValues = 0;
WriteLog (lsTRACE, UniqueNodeList) JLOG (j_.trace)
<< str (boost::format ("Validator: '%s' : '%s' : processing %d validators.") << str (boost::format ("Validator: '%s' : '%s' : processing %d validators.")
% strSite % strSite
% strValidatorsSrc % strValidatorsSrc
@@ -1988,7 +2002,7 @@ int UniqueNodeListImp::processValidators (std::string const& strSite, std::strin
// Remove all current Validator's entries in ValidatorReferrals // Remove all current Validator's entries in ValidatorReferrals
{ {
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
*db << str (boost::format ("DELETE FROM ValidatorReferrals WHERE Validator='%s';") % strNodePublic); *db << str (boost::format ("DELETE FROM ValidatorReferrals WHERE Validator='%s';") % strNodePublic);
// XXX Check result. // XXX Check result.
@@ -2014,7 +2028,7 @@ int UniqueNodeListImp::processValidators (std::string const& strSite, std::strin
if (!boost::regex_match (strReferral, smMatch, reReferral)) if (!boost::regex_match (strReferral, smMatch, reReferral))
{ {
WriteLog (lsWARNING, UniqueNodeList) << str (boost::format ("Bad validator: syntax error: %s: %s") % strSite % strReferral); JLOG (j_.warning) << str (boost::format ("Bad validator: syntax error: %s: %s") % strSite % strReferral);
} }
else else
{ {
@@ -2024,7 +2038,7 @@ int UniqueNodeListImp::processValidators (std::string const& strSite, std::strin
if (naValidator.setSeedGeneric (strRefered)) if (naValidator.setSeedGeneric (strRefered))
{ {
WriteLog (lsWARNING, UniqueNodeList) << str (boost::format ("Bad validator: domain or public key required: %s %s") % strRefered % strComment); JLOG (j_.warning) << str (boost::format ("Bad validator: domain or public key required: %s %s") % strRefered % strComment);
} }
else if (naValidator.setNodePublic (strRefered)) else if (naValidator.setNodePublic (strRefered))
{ {
@@ -2032,7 +2046,7 @@ int UniqueNodeListImp::processValidators (std::string const& strSite, std::strin
// XXX Schedule for CAS lookup. // XXX Schedule for CAS lookup.
nodeAddPublic (naValidator, vsWhy, strComment); nodeAddPublic (naValidator, vsWhy, strComment);
WriteLog (lsINFO, UniqueNodeList) << str (boost::format ("Node Public: %s %s") % strRefered % strComment); JLOG (j_.info) << str (boost::format ("Node Public: %s %s") % strRefered % strComment);
if (naNodePublic.isValid ()) if (naNodePublic.isValid ())
vstrValues.push_back (str (boost::format ("('%s',%d,'%s')") % strNodePublic % iValues % naValidator.humanNodePublic ())); vstrValues.push_back (str (boost::format ("('%s',%d,'%s')") % strNodePublic % iValues % naValidator.humanNodePublic ()));
@@ -2044,7 +2058,7 @@ int UniqueNodeListImp::processValidators (std::string const& strSite, std::strin
// A domain: need to look it up. // A domain: need to look it up.
nodeAddDomain (strRefered, vsWhy, strComment); nodeAddDomain (strRefered, vsWhy, strComment);
WriteLog (lsINFO, UniqueNodeList) << str (boost::format ("Node Domain: %s %s") % strRefered % strComment); JLOG (j_.info) << str (boost::format ("Node Domain: %s %s") % strRefered % strComment);
if (naNodePublic.isValid ()) if (naNodePublic.isValid ())
vstrValues.push_back (str (boost::format ("('%s',%d,%s)") % strNodePublic % iValues % sqlEscape (strRefered))); vstrValues.push_back (str (boost::format ("('%s',%d,%s)") % strNodePublic % iValues % sqlEscape (strRefered)));
@@ -2059,7 +2073,7 @@ int UniqueNodeListImp::processValidators (std::string const& strSite, std::strin
std::string strSql = str (boost::format ("INSERT INTO ValidatorReferrals (Validator,Entry,Referral) VALUES %s;") std::string strSql = str (boost::format ("INSERT INTO ValidatorReferrals (Validator,Entry,Referral) VALUES %s;")
% strJoin (vstrValues.begin (), vstrValues.end (), ",")); % strJoin (vstrValues.begin (), vstrValues.end (), ","));
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
*db << strSql; *db << strSql;
// XXX Check result. // XXX Check result.
@@ -2095,7 +2109,7 @@ void UniqueNodeListImp::processFile (std::string const& strDomain, RippleAddress
if ((pvCurrencies = getIniFileSection (secSite, SECTION_CURRENCIES)) && pvCurrencies->size ()) if ((pvCurrencies = getIniFileSection (secSite, SECTION_CURRENCIES)) && pvCurrencies->size ())
{ {
// XXX Process currencies. // XXX Process currencies.
WriteLog (lsWARNING, UniqueNodeList) << "Ignoring currencies: not implemented."; JLOG (j_.warning) << "Ignoring currencies: not implemented.";
} }
getValidatorsUrl (naNodePublic, secSite); getValidatorsUrl (naNodePublic, secSite);
@@ -2114,7 +2128,7 @@ bool UniqueNodeListImp::getSeedDomains (std::string const& strDomain, seedDomain
"Comment FROM SeedDomains WHERE Domain=%s;") % "Comment FROM SeedDomains WHERE Domain=%s;") %
sqlEscape (strDomain)); sqlEscape (strDomain));
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
// Iterate through the result rows with a fectch b/c putting a // Iterate through the result rows with a fectch b/c putting a
// column of type DATETIME into a boost::tuple can throw when the // column of type DATETIME into a boost::tuple can throw when the
@@ -2193,7 +2207,7 @@ void UniqueNodeListImp::setSeedDomains (const seedDomain& sdSource, bool bNext)
int iScan = iToSeconds (sdSource.tpScan); int iScan = iToSeconds (sdSource.tpScan);
int iFetch = iToSeconds (sdSource.tpFetch); int iFetch = iToSeconds (sdSource.tpFetch);
// WriteLog (lsTRACE) << str(boost::format("setSeedDomains: iNext=%s tpNext=%s") % iNext % sdSource.tpNext); // JLOG (lsTRACE) << str(boost::format("setSeedDomains: iNext=%s tpNext=%s") % iNext % sdSource.tpNext);
std::string strSql = boost::str (boost::format ("REPLACE INTO SeedDomains (Domain,PublicKey,Source,Next,Scan,Fetch,Sha256,Comment) VALUES (%s, %s, %s, %d, %d, %d, '%s', %s);") std::string strSql = boost::str (boost::format ("REPLACE INTO SeedDomains (Domain,PublicKey,Source,Next,Scan,Fetch,Sha256,Comment) VALUES (%s, %s, %s, %d, %d, %d, '%s', %s);")
% sqlEscape (sdSource.strDomain) % sqlEscape (sdSource.strDomain)
@@ -2206,7 +2220,7 @@ void UniqueNodeListImp::setSeedDomains (const seedDomain& sdSource, bool bNext)
% sqlEscape (sdSource.strComment) % sqlEscape (sdSource.strComment)
); );
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
try try
{ {
@@ -2215,7 +2229,7 @@ void UniqueNodeListImp::setSeedDomains (const seedDomain& sdSource, bool bNext)
catch (soci::soci_error& e) catch (soci::soci_error& e)
{ {
// XXX Check result. // XXX Check result.
WriteLog (lsWARNING, UniqueNodeList) << "setSeedDomains: failed. Error: " << e.what(); JLOG (j_.warning) << "setSeedDomains: failed. Error: " << e.what();
} }
if (bNext && (mtpFetchNext.is_not_a_date_time () || mtpFetchNext > sdSource.tpNext)) if (bNext && (mtpFetchNext.is_not_a_date_time () || mtpFetchNext > sdSource.tpNext))
@@ -2237,7 +2251,7 @@ bool UniqueNodeListImp::getSeedNodes (RippleAddress const& naNodePublic, seedNod
"Comment FROM SeedNodes WHERE PublicKey='%s';") % "Comment FROM SeedNodes WHERE PublicKey='%s';") %
naNodePublic.humanNodePublic ()); naNodePublic.humanNodePublic ());
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
std::string strPublicKey; std::string strPublicKey;
std::string strSource; std::string strSource;
@@ -2302,7 +2316,7 @@ void UniqueNodeListImp::setSeedNodes (const seedNode& snSource, bool bNext)
int iScan = iToSeconds (snSource.tpScan); int iScan = iToSeconds (snSource.tpScan);
int iFetch = iToSeconds (snSource.tpFetch); int iFetch = iToSeconds (snSource.tpFetch);
// WriteLog (lsTRACE) << str(boost::format("setSeedNodes: iNext=%s tpNext=%s") % iNext % sdSource.tpNext); // JLOG (lsTRACE) << str(boost::format("setSeedNodes: iNext=%s tpNext=%s") % iNext % sdSource.tpNext);
assert (snSource.naPublicKey.isValid ()); assert (snSource.naPublicKey.isValid ());
@@ -2317,7 +2331,7 @@ void UniqueNodeListImp::setSeedNodes (const seedNode& snSource, bool bNext)
); );
{ {
auto db = getApp().getWalletDB ().checkoutDb (); auto db = app_.getWalletDB ().checkoutDb ();
try try
{ {
@@ -2325,7 +2339,7 @@ void UniqueNodeListImp::setSeedNodes (const seedNode& snSource, bool bNext)
} }
catch(soci::soci_error& e) catch(soci::soci_error& e)
{ {
WriteLog (lsTRACE, UniqueNodeList) << "setSeedNodes: failed. Error: " << e.what (); JLOG (j_.trace) << "setSeedNodes: failed. Error: " << e.what ();
} }
} }
@@ -2351,18 +2365,18 @@ bool UniqueNodeListImp::validatorsResponse (const boost::system::error_code& err
if (!bReject) if (!bReject)
{ {
WriteLog (lsTRACE, UniqueNodeList) << JLOG (j_.trace) <<
"Fetch '" << "Fetch '" <<
Config::Helpers::getValidatorsFileName () << Config::Helpers::getValidatorsFileName () <<
"' complete."; "' complete.";
if (!err) if (!err)
{ {
nodeProcess ("network", strResponse, getConfig ().VALIDATORS_SITE); nodeProcess ("network", strResponse, app_.config().VALIDATORS_SITE);
} }
else else
{ {
WriteLog (lsWARNING, UniqueNodeList) << "Error: " << err.message (); JLOG (j_.warning) << "Error: " << err.message ();
} }
} }
return bReject; return bReject;
@@ -2391,17 +2405,17 @@ void UniqueNodeListImp::nodeProcess (std::string const& strSite, std::string con
} }
else else
{ {
WriteLog (lsWARNING, UniqueNodeList) << boost::str (boost::format ("'%s' missing [" SECTION_VALIDATORS "].") JLOG (j_.warning) << boost::str (boost::format ("'%s' missing [" SECTION_VALIDATORS "].")
% getConfig ().VALIDATORS_BASE); % app_.config().VALIDATORS_BASE);
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::unique_ptr<UniqueNodeList> std::unique_ptr<UniqueNodeList>
make_UniqueNodeList (beast::Stoppable& parent) make_UniqueNodeList (Application& app, beast::Stoppable& parent)
{ {
return std::make_unique<UniqueNodeListImp> (parent); return std::make_unique<UniqueNodeListImp> (app, parent);
} }
} // ripple } // ripple

View File

@@ -20,6 +20,7 @@
#ifndef RIPPLE_APP_PEERS_UNIQUENODELIST_H_INCLUDED #ifndef RIPPLE_APP_PEERS_UNIQUENODELIST_H_INCLUDED
#define RIPPLE_APP_PEERS_UNIQUENODELIST_H_INCLUDED #define RIPPLE_APP_PEERS_UNIQUENODELIST_H_INCLUDED
#include <ripple/app/main/Application.h>
#include <ripple/overlay/ClusterNodeStatus.h> #include <ripple/overlay/ClusterNodeStatus.h>
#include <ripple/protocol/PublicKey.h> #include <ripple/protocol/PublicKey.h>
#include <ripple/protocol/RippleAddress.h> #include <ripple/protocol/RippleAddress.h>
@@ -85,7 +86,7 @@ public:
}; };
std::unique_ptr<UniqueNodeList> std::unique_ptr<UniqueNodeList>
make_UniqueNodeList (beast::Stoppable& parent); make_UniqueNodeList (Application& app, beast::Stoppable& parent);
} // ripple } // ripple

Some files were not shown because too many files have changed in this diff Show More