Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propose 1.9.1-b1 #4158

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions Builds/CMake/RippledCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ target_sources (xrpl_core PRIVATE
src/ripple/protocol/impl/PublicKey.cpp
src/ripple/protocol/impl/Quality.cpp
src/ripple/protocol/impl/Rate2.cpp
src/ripple/protocol/impl/Rules.cpp
src/ripple/protocol/impl/SField.cpp
src/ripple/protocol/impl/SOTemplate.cpp
src/ripple/protocol/impl/STAccount.cpp
Expand Down Expand Up @@ -209,6 +210,7 @@ install (
src/ripple/protocol/PublicKey.h
src/ripple/protocol/Quality.h
src/ripple/protocol/Rate.h
src/ripple/protocol/Rules.h
src/ripple/protocol/SField.h
src/ripple/protocol/SOTemplate.h
src/ripple/protocol/STAccount.h
Expand Down Expand Up @@ -400,13 +402,18 @@ target_sources (rippled PRIVATE
src/ripple/app/paths/impl/DirectStep.cpp
src/ripple/app/paths/impl/PaySteps.cpp
src/ripple/app/paths/impl/XRPEndpointStep.cpp
src/ripple/app/rdb/backend/RelationalDBInterfacePostgres.cpp
src/ripple/app/rdb/backend/RelationalDBInterfaceSqlite.cpp
src/ripple/app/rdb/impl/RelationalDBInterface.cpp
src/ripple/app/rdb/impl/RelationalDBInterface_global.cpp
src/ripple/app/rdb/impl/RelationalDBInterface_nodes.cpp
src/ripple/app/rdb/impl/RelationalDBInterface_postgres.cpp
src/ripple/app/rdb/impl/RelationalDBInterface_shards.cpp
src/ripple/app/rdb/backend/detail/impl/Node.cpp
src/ripple/app/rdb/backend/detail/impl/Shard.cpp
src/ripple/app/rdb/backend/impl/PostgresDatabase.cpp
src/ripple/app/rdb/backend/impl/SQLiteDatabase.cpp
src/ripple/app/rdb/impl/Download.cpp
src/ripple/app/rdb/impl/PeerFinder.cpp
src/ripple/app/rdb/impl/RelationalDatabase.cpp
src/ripple/app/rdb/impl/ShardArchive.cpp
src/ripple/app/rdb/impl/State.cpp
src/ripple/app/rdb/impl/UnitaryShard.cpp
src/ripple/app/rdb/impl/Vacuum.cpp
src/ripple/app/rdb/impl/Wallet.cpp
src/ripple/app/tx/impl/ApplyContext.cpp
src/ripple/app/tx/impl/BookTip.cpp
src/ripple/app/tx/impl/CancelCheck.cpp
Expand Down
6 changes: 2 additions & 4 deletions Builds/CMake/RippledSanity.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
"directory from ${CMAKE_CURRENT_SOURCE_DIR} and try building in a separate directory.")
endif ()

if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio" AND
NOT ("${CMAKE_GENERATOR}" MATCHES .*Win64.*))
message (FATAL_ERROR
"Visual Studio 32-bit build is not supported. Use -G\"${CMAKE_GENERATOR} Win64\"")
if (MSVC AND CMAKE_GENERATOR_PLATFORM STREQUAL "Win32")
message (FATAL_ERROR "Visual Studio 32-bit build is not supported.")
endif ()

if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
Expand Down
2 changes: 1 addition & 1 deletion Builds/levelization/results/loops.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Loop: ripple.app ripple.overlay
ripple.overlay ~= ripple.app

Loop: ripple.app ripple.peerfinder
ripple.peerfinder ~= ripple.app
ripple.app > ripple.peerfinder

Loop: ripple.app ripple.rpc
ripple.rpc > ripple.app
Expand Down
15 changes: 4 additions & 11 deletions cfg/rippled-example.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1140,17 +1140,10 @@
# The online delete process checks periodically
# that rippled is still in sync with the network,
# and that the validated ledger is less than
# 'age_threshold_seconds' old. By default, if it
# is not the online delete process aborts and
# tries again later. If 'recovery_wait_seconds'
# is set and rippled is out of sync, but likely to
# recover quickly, then online delete will wait
# this number of seconds for rippled to get back
# into sync before it aborts.
# Set this value if the node is otherwise staying
# in sync, or recovering quickly, but the online
# delete process is unable to finish.
# Default is unset.
# 'age_threshold_seconds' old. If not, then continue
# sleeping for this number of seconds and
# checking until healthy.
# Default is 5.
#
# Optional keys for Cassandra:
#
Expand Down
2 changes: 1 addition & 1 deletion src/ripple/app/consensus/RCLConsensus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ RCLConsensus::Adaptor::doAccept(
auto const lastVal = ledgerMaster_.getValidatedLedger();
std::optional<Rules> rules;
if (lastVal)
rules.emplace(*lastVal, app_.config().features);
rules = makeRulesGivenLedger(*lastVal, app_.config().features);
else
rules.emplace(app_.config().features);
app_.openLedger().accept(
Expand Down
29 changes: 17 additions & 12 deletions src/ripple/app/ledger/Ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#include <ripple/app/misc/HashRouter.h>
#include <ripple/app/misc/LoadFeeTrack.h>
#include <ripple/app/misc/NetworkOPs.h>
#include <ripple/app/rdb/backend/RelationalDBInterfacePostgres.h>
#include <ripple/app/rdb/backend/RelationalDBInterfaceSqlite.h>
#include <ripple/app/rdb/backend/PostgresDatabase.h>
#include <ripple/app/rdb/backend/SQLiteDatabase.h>
#include <ripple/basics/Log.h>
#include <ripple/basics/StringUtilities.h>
#include <ripple/basics/contract.h>
Expand Down Expand Up @@ -626,7 +626,7 @@ Ledger::setup(Config const& config)

try
{
rules_ = Rules(*this, config.features);
rules_ = makeRulesGivenLedger(*this, config.features);
}
catch (SHAMapMissingNode const&)
{
Expand Down Expand Up @@ -930,9 +930,11 @@ saveValidatedLedger(
return true;
}

auto res = dynamic_cast<RelationalDBInterfaceSqlite*>(
&app.getRelationalDBInterface())
->saveValidatedLedger(ledger, current);
auto const db = dynamic_cast<SQLiteDatabase*>(&app.getRelationalDatabase());
if (!db)
Throw<std::runtime_error>("Failed to get relational database");

auto const res = db->saveValidatedLedger(ledger, current);

// Clients can now trust the database for
// information about this ledger sequence.
Expand Down Expand Up @@ -1053,7 +1055,7 @@ std::tuple<std::shared_ptr<Ledger>, std::uint32_t, uint256>
getLatestLedger(Application& app)
{
const std::optional<LedgerInfo> info =
app.getRelationalDBInterface().getNewestLedgerInfo();
app.getRelationalDatabase().getNewestLedgerInfo();
if (!info)
return {std::shared_ptr<Ledger>(), {}, {}};
return {loadLedgerHelper(*info, app, true), info->seq, info->hash};
Expand All @@ -1063,7 +1065,7 @@ std::shared_ptr<Ledger>
loadByIndex(std::uint32_t ledgerIndex, Application& app, bool acquire)
{
if (std::optional<LedgerInfo> info =
app.getRelationalDBInterface().getLedgerInfoByIndex(ledgerIndex))
app.getRelationalDatabase().getLedgerInfoByIndex(ledgerIndex))
{
std::shared_ptr<Ledger> ledger = loadLedgerHelper(*info, app, acquire);
finishLoadByIndexOrHash(ledger, app.config(), app.journal("Ledger"));
Expand All @@ -1076,7 +1078,7 @@ std::shared_ptr<Ledger>
loadByHash(uint256 const& ledgerHash, Application& app, bool acquire)
{
if (std::optional<LedgerInfo> info =
app.getRelationalDBInterface().getLedgerInfoByHash(ledgerHash))
app.getRelationalDatabase().getLedgerInfoByHash(ledgerHash))
{
std::shared_ptr<Ledger> ledger = loadLedgerHelper(*info, app, acquire);
finishLoadByIndexOrHash(ledger, app.config(), app.journal("Ledger"));
Expand Down Expand Up @@ -1165,9 +1167,12 @@ flatFetchTransactions(ReadView const& ledger, Application& app)
return {};
}

auto nodestoreHashes = dynamic_cast<RelationalDBInterfacePostgres*>(
&app.getRelationalDBInterface())
->getTxHashes(ledger.info().seq);
auto const db =
dynamic_cast<PostgresDatabase*>(&app.getRelationalDatabase());
if (!db)
Throw<std::runtime_error>("Failed to get relational database");

auto nodestoreHashes = db->getTxHashes(ledger.info().seq);

return flatFetchTransactions(app, nodestoreHashes);
}
Expand Down
20 changes: 10 additions & 10 deletions src/ripple/app/ledger/impl/InboundLedger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,35 +44,35 @@ using namespace std::chrono_literals;

enum {
// Number of peers to start with
peerCountStart = 4
peerCountStart = 5

// Number of peers to add on a timeout
,
peerCountAdd = 2
peerCountAdd = 3

// how many timeouts before we give up
,
ledgerTimeoutRetriesMax = 10
ledgerTimeoutRetriesMax = 6

// how many timeouts before we get aggressive
,
ledgerBecomeAggressiveThreshold = 6
ledgerBecomeAggressiveThreshold = 4

// Number of nodes to find initially
,
missingNodesFind = 512
missingNodesFind = 256

// Number of nodes to request for a reply
,
reqNodesReply = 256
reqNodesReply = 128

// Number of nodes to request blindly
,
reqNodes = 12
};

// millisecond for each ledger timeout
auto constexpr ledgerAcquireTimeout = 2500ms;
auto constexpr ledgerAcquireTimeout = 3000ms;

InboundLedger::InboundLedger(
Application& app,
Expand Down Expand Up @@ -664,15 +664,15 @@ InboundLedger::trigger(std::shared_ptr<Peer> const& peer, TriggerReason reason)
if (reason != TriggerReason::reply)
{
// If we're querying blind, don't query deep
tmGL.set_querydepth(1);
tmGL.set_querydepth(0);
}
else if (peer && peer->isHighLatency())
{
// If the peer has high latency, query extra deep
tmGL.set_querydepth(3);
tmGL.set_querydepth(2);
}
else
tmGL.set_querydepth(2);
tmGL.set_querydepth(1);

// Get the state data first because it's the most likely to be useful
// if we wind up abandoning this fetch.
Expand Down
27 changes: 12 additions & 15 deletions src/ripple/app/ledger/impl/LedgerMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
#include <ripple/app/misc/TxQ.h>
#include <ripple/app/misc/ValidatorList.h>
#include <ripple/app/paths/PathRequests.h>
#include <ripple/app/rdb/RelationalDBInterface_postgres.h>
#include <ripple/app/rdb/backend/RelationalDBInterfacePostgres.h>
#include <ripple/app/rdb/backend/PostgresDatabase.h>
#include <ripple/app/tx/apply.h>
#include <ripple/basics/Log.h>
#include <ripple/basics/MathUtilities.h>
Expand Down Expand Up @@ -278,10 +277,10 @@ LedgerMaster::getValidatedLedgerAge()

#ifdef RIPPLED_REPORTING
if (app_.config().reporting())
return static_cast<RelationalDBInterfacePostgres*>(
&app_.getRelationalDBInterface())
return static_cast<PostgresDatabase*>(&app_.getRelationalDatabase())
->getValidatedLedgerAge();
#endif

std::chrono::seconds valClose{mValidLedgerSign.load()};
if (valClose == 0s)
{
Expand Down Expand Up @@ -309,8 +308,7 @@ LedgerMaster::isCaughtUp(std::string& reason)

#ifdef RIPPLED_REPORTING
if (app_.config().reporting())
return static_cast<RelationalDBInterfacePostgres*>(
&app_.getRelationalDBInterface())
return static_cast<PostgresDatabase*>(&app_.getRelationalDatabase())
->isCaughtUp(reason);
#endif

Expand Down Expand Up @@ -743,7 +741,7 @@ LedgerMaster::tryFill(std::shared_ptr<Ledger const> ledger)
mCompleteLedgers.insert(range(minHas, maxHas));
}
maxHas = minHas;
ledgerHashes = app_.getRelationalDBInterface().getHashesByIndex(
ledgerHashes = app_.getRelationalDatabase().getHashesByIndex(
(seq < 500) ? 0 : (seq - 499), seq);
it = ledgerHashes.find(seq);

Expand Down Expand Up @@ -927,8 +925,8 @@ LedgerMaster::setFullLedger(
{
// Check the SQL database's entry for the sequence before this
// ledger, if it's not this ledger's parent, invalidate it
uint256 prevHash = app_.getRelationalDBInterface().getHashByIndex(
ledger->info().seq - 1);
uint256 prevHash =
app_.getRelationalDatabase().getHashByIndex(ledger->info().seq - 1);
if (prevHash.isNonZero() && prevHash != ledger->info().parentHash)
clearLedger(ledger->info().seq - 1);
}
Expand Down Expand Up @@ -1664,7 +1662,7 @@ LedgerMaster::getValidatedLedger()
#ifdef RIPPLED_REPORTING
if (app_.config().reporting())
{
auto seq = app_.getRelationalDBInterface().getMaxLedgerSeq();
auto seq = app_.getRelationalDatabase().getMaxLedgerSeq();
if (!seq)
return {};
return getLedgerBySeq(*seq);
Expand Down Expand Up @@ -1700,8 +1698,7 @@ LedgerMaster::getCompleteLedgers()
{
#ifdef RIPPLED_REPORTING
if (app_.config().reporting())
return static_cast<RelationalDBInterfacePostgres*>(
&app_.getRelationalDBInterface())
return static_cast<PostgresDatabase*>(&app_.getRelationalDatabase())
->getCompleteLedgers();
#endif
std::lock_guard sl(mCompleteLock);
Expand Down Expand Up @@ -1746,7 +1743,7 @@ LedgerMaster::getHashBySeq(std::uint32_t index)
if (hash.isNonZero())
return hash;

return app_.getRelationalDBInterface().getHashByIndex(index);
return app_.getRelationalDatabase().getHashByIndex(index);
}

std::optional<LedgerHash>
Expand Down Expand Up @@ -1967,7 +1964,7 @@ LedgerMaster::fetchForHistory(
fillInProgress = mFillInProgress;
}
if (fillInProgress == 0 &&
app_.getRelationalDBInterface().getHashByIndex(seq - 1) ==
app_.getRelationalDatabase().getHashByIndex(seq - 1) ==
ledger->info().parentHash)
{
{
Expand Down Expand Up @@ -2363,7 +2360,7 @@ LedgerMaster::getFetchPackCacheSize() const
std::optional<LedgerIndex>
LedgerMaster::minSqlSeq()
{
return app_.getRelationalDBInterface().getMinLedgerSeq();
return app_.getRelationalDatabase().getMinLedgerSeq();
}

} // namespace ripple
Loading