diff --git a/src/ripple/app/ledger/Ledger.h b/src/ripple/app/ledger/Ledger.h index 84e65ecff..0d4a5646f 100644 --- a/src/ripple/app/ledger/Ledger.h +++ b/src/ripple/app/ledger/Ledger.h @@ -416,7 +416,7 @@ private: /** A ledger wrapped in a CachedView. */ using CachedLedger = CachedView; -std::uint32_t constexpr FLAG_LEDGER_INTERVAL = 256; +std::uint32_t constexpr FLAG_LEDGER_INTERVAL = 16; /** Returns true if the given ledgerIndex is a flag ledgerIndex */ bool isFlagLedger(LedgerIndex seq); diff --git a/src/ripple/app/misc/NegativeUNLVote.cpp b/src/ripple/app/misc/NegativeUNLVote.cpp index 1f169a233..d2fa4c121 100644 --- a/src/ripple/app/misc/NegativeUNLVote.cpp +++ b/src/ripple/app/misc/NegativeUNLVote.cpp @@ -113,20 +113,24 @@ NegativeUNLVote::addReportingTx( hash_map const& nidToKeyMap, std::shared_ptr const& initalSet) { - std::vector active; - active.reserve(scoreTable.size()); + std::set ordered; + for (auto const& [n, score]: scoreTable) { if (score > (FLAG_LEDGER_INTERVAL>>1)) - { - active.emplace_back(sfActiveValidator); - active.back().setFieldVL(sfPublicKey, nidToKeyMap.at(n)); - } + ordered.emplace(nidToKeyMap.at(n)); + } + + std::vector av; + for (auto const& k : ordered) + { + av.emplace_back(sfActiveValidator); + av.back().setFieldVL(sfPublicKey, k); } STTx repUnlTx(ttUNL_REPORT, [&](auto& obj) { - obj.setFieldArray(sfActiveValidators, STArray(active, sfActiveValidators)); + obj.setFieldArray(sfActiveValidators, STArray(av, sfActiveValidators)); obj.setFieldU32(sfLedgerSequence, seq); }); diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp index cd479acf6..cf8c4f97f 100644 --- a/src/ripple/app/misc/NetworkOPs.cpp +++ b/src/ripple/app/misc/NetworkOPs.cpp @@ -79,9 +79,6 @@ namespace ripple { class NetworkOPsImp final : public NetworkOPs { - // ledger_seq -> validator key -> validation message - std::map> xpop_history; - /** * Transaction with input flags and results to be applied in batches. */ @@ -2341,37 +2338,6 @@ NetworkOPsImp::recvValidation( handleNewValidation(app_, val, source); - // manage xpop validation history - if (app_.config().XPOP_HISTORY) - { - if (val->isTrusted()) - { - uint32_t seq = val->getFieldU32(sfLedgerSequence); - - if (xpop_history.find(seq) == xpop_history.end()) - xpop_history.emplace(seq, std::map{}); - - xpop_history[seq].emplace(val->getSignerPublic(), *val); - } - - uint32_t delete_threshold = - app_.getLedgerMaster().getValidLedgerIndex() + 1 - *(app_.config().XPOP_HISTORY); - - if (xpop_history.find(delete_threshold) != xpop_history.end()) - xpop_history.erase(delete_threshold); - - if (xpop_history.size() > *(app_.config().XPOP_HISTORY)) - { - std::unordered_set to_delete; - for (auto const& kp : xpop_history) - if (kp.first < delete_threshold) - to_delete.emplace(kp.first); - - for (uint32_t td: to_delete) - xpop_history.erase(td); - } - } - pubValidation(val); // We will always relay trusted validations; if configured, we will diff --git a/src/ripple/app/tx/impl/Change.cpp b/src/ripple/app/tx/impl/Change.cpp index 44c4b224a..880e58f9e 100644 --- a/src/ripple/app/tx/impl/Change.cpp +++ b/src/ripple/app/tx/impl/Change.cpp @@ -202,6 +202,9 @@ Change::preCompute() void Change::activateXahauGenesis() { + + return; + JLOG(j_.warn()) << "featureXahauGenesis amendment activation code starting"; constexpr XRPAmount GENESIS { 1'000'000 * DROPS_PER_XRP }; diff --git a/src/ripple/core/Config.h b/src/ripple/core/Config.h index 412f9d0bf..22bab77b6 100644 --- a/src/ripple/core/Config.h +++ b/src/ripple/core/Config.h @@ -176,10 +176,6 @@ public: int RELAY_UNTRUSTED_VALIDATIONS = 1; int RELAY_UNTRUSTED_PROPOSALS = 0; - // The number of ledgers worth of valdiations to keep for the purpose - // of servicing xpop requests these are lost on restart - std::optional XPOP_HISTORY; - // True to ask peers not to relay current IP. bool PEER_PRIVATE = false; // peers_max is a legacy configuration, which is going to be replaced diff --git a/src/ripple/core/ConfigSections.h b/src/ripple/core/ConfigSections.h index 6f67d50a5..27f38bc6e 100644 --- a/src/ripple/core/ConfigSections.h +++ b/src/ripple/core/ConfigSections.h @@ -99,7 +99,6 @@ struct ConfigSection #define SECTION_LEDGER_REPLAY "ledger_replay" #define SECTION_BETA_RPC_API "beta_rpc_api" #define SECTION_SWEEP_INTERVAL "sweep_interval" -#define SECTION_XPOP_HISTORY "xpop_history" #define SECTION_NETWORK_ID "network_id" #define SECTION_IMPORT_VL_KEYS "import_vl_keys" diff --git a/src/ripple/core/impl/Config.cpp b/src/ripple/core/impl/Config.cpp index 8ca2dac6d..fa23413ae 100644 --- a/src/ripple/core/impl/Config.cpp +++ b/src/ripple/core/impl/Config.cpp @@ -502,9 +502,6 @@ Config::loadFromString(std::string const& fileContents) std::string strTemp; - if (getSingleSection(secConfig, SECTION_XPOP_HISTORY, strTemp, j_)) - XPOP_HISTORY = beast::lexicalCastThrow(strTemp); - if (getSingleSection(secConfig, SECTION_NETWORK_ID, strTemp, j_)) { if (strTemp == "main") diff --git a/src/ripple/protocol/SystemParameters.h b/src/ripple/protocol/SystemParameters.h index 85592560e..c6b47e54e 100644 --- a/src/ripple/protocol/SystemParameters.h +++ b/src/ripple/protocol/SystemParameters.h @@ -85,7 +85,8 @@ constexpr std::ratio<204, 256> preFixAmendmentMajorityCalcThreshold; constexpr std::ratio<80, 100> postFixAmendmentMajorityCalcThreshold; /** The minimum amount of time an amendment must hold a majority */ -constexpr std::chrono::seconds const defaultAmendmentMajorityTime = days{5}; +constexpr std::chrono::seconds const defaultAmendmentMajorityTime = std::chrono::seconds{16}; +//days{5}; } // namespace ripple diff --git a/src/ripple/protocol/impl/Feature.cpp b/src/ripple/protocol/impl/Feature.cpp index cf241fa4a..ca5d21dde 100644 --- a/src/ripple/protocol/impl/Feature.cpp +++ b/src/ripple/protocol/impl/Feature.cpp @@ -454,10 +454,10 @@ REGISTER_FIX (fixNonFungibleTokensV1_2, Supported::yes, VoteBehavior::De REGISTER_FIX (fixNFTokenRemint, Supported::yes, VoteBehavior::DefaultNo); REGISTER_FEATURE(Hooks, Supported::yes, VoteBehavior::DefaultYes); REGISTER_FEATURE(BalanceRewards, Supported::yes, VoteBehavior::DefaultYes); -REGISTER_FEATURE(PaychanAndEscrowForTokens, Supported::yes, VoteBehavior::DefaultNo); -REGISTER_FEATURE(URIToken, Supported::yes, VoteBehavior::DefaultNo); -REGISTER_FEATURE(Import, Supported::yes, VoteBehavior::DefaultNo); -REGISTER_FEATURE(XahauGenesis, Supported::yes, VoteBehavior::DefaultNo); +REGISTER_FEATURE(PaychanAndEscrowForTokens, Supported::yes, VoteBehavior::DefaultYes); +REGISTER_FEATURE(URIToken, Supported::yes, VoteBehavior::DefaultYes); +REGISTER_FEATURE(Import, Supported::yes, VoteBehavior::DefaultYes); +REGISTER_FEATURE(XahauGenesis, Supported::yes, VoteBehavior::DefaultYes); // The following amendments are obsolete, but must remain supported // because they could potentially get enabled.