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

Proposed 1.7.0-b1 #3599

Merged
merged 16 commits into from
Sep 8, 2020
Merged
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
55 changes: 55 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!--
This PR template helps you to write a good pull request description.
Please feel free to include additional useful information even beyond what is requested below.
-->

## High Level Overview of Change

<!--
Please include a summary of the changes.
This may be a direct input to the release notes.
If too broad, please consider splitting into multiple PRs.
If a relevant task or issue, please link it here.
-->

### Context of Change

<!--
Please include the context of a change.
If a bug fix, when was the bug introduced? What was the behavior?
If a new feature, why was this architecture chosen? What were the alternatives?
If a refactor, how is this better than the previous implementation?

If there is a spec or design document for this feature, please link it here.
-->

### Type of Change

<!--
Please check [x] relevant options, delete irrelevant ones.
-->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Refactor (non-breaking change that only restructures code)
- [ ] Tests (You added tests for code that already exists, or your new feature included in this PR)
- [ ] Documentation Updates
- [ ] Release

<!--
## Before / After
If relevant, use this section for an English description of the change at a technical level.
If this change affects an API, examples should be included here.
-->

<!--
## Test Plan
If helpful, please describe the tests that you ran to verify your changes and provide instructions so that others can reproduce.
This section may not be needed if your change includes thoroughly commented unit tests.
-->

<!--
## Future Tasks
For future tasks related to PR.
-->
6 changes: 5 additions & 1 deletion Builds/CMake/RippledCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ install (
src/ripple/protocol/STVector256.h
src/ripple/protocol/SecretKey.h
src/ripple/protocol/Seed.h
src/ripple/protocol/SeqProxy.h
src/ripple/protocol/Serializer.h
src/ripple/protocol/Sign.h
src/ripple/protocol/SystemParameters.h
Expand Down Expand Up @@ -385,6 +386,7 @@ target_sources (rippled PRIVATE
src/ripple/app/misc/NegativeUNLVote.cpp
src/ripple/app/misc/NetworkOPs.cpp
src/ripple/app/misc/SHAMapStoreImp.cpp
src/ripple/app/misc/detail/impl/WorkSSL.cpp
src/ripple/app/misc/impl/AccountTxPaging.cpp
src/ripple/app/misc/impl/AmendmentTable.cpp
src/ripple/app/misc/impl/LoadFeeTrack.cpp
Expand All @@ -411,7 +413,6 @@ target_sources (rippled PRIVATE
src/ripple/app/tx/impl/BookTip.cpp
src/ripple/app/tx/impl/CancelCheck.cpp
src/ripple/app/tx/impl/CancelOffer.cpp
src/ripple/app/tx/impl/CancelTicket.cpp
src/ripple/app/tx/impl/CashCheck.cpp
src/ripple/app/tx/impl/Change.cpp
src/ripple/app/tx/impl/CreateCheck.cpp
Expand Down Expand Up @@ -663,6 +664,7 @@ target_sources (rippled PRIVATE
src/test/app/DeliverMin_test.cpp
src/test/app/DepositAuth_test.cpp
src/test/app/Discrepancy_test.cpp
src/test/app/DNS_test.cpp
src/test/app/Escrow_test.cpp
src/test/app/FeeVote_test.cpp
src/test/app/Flow_test.cpp
Expand Down Expand Up @@ -867,6 +869,7 @@ target_sources (rippled PRIVATE
src/test/overlay/cluster_test.cpp
src/test/overlay/short_read_test.cpp
src/test/overlay/compression_test.cpp
src/test/overlay/reduce_relay_test.cpp
#[===============================[
test sources:
subdir: peerfinder
Expand All @@ -889,6 +892,7 @@ target_sources (rippled PRIVATE
src/test/protocol/STValidation_test.cpp
src/test/protocol/SecretKey_test.cpp
src/test/protocol/Seed_test.cpp
src/test/protocol/SeqProxy_test.cpp
src/test/protocol/TER_test.cpp
src/test/protocol/digest_test.cpp
src/test/protocol/types_test.cpp
Expand Down
1 change: 1 addition & 0 deletions bin/ci/ubuntu/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ else
# ORDER matters here...sorted in approximately
# descending execution time (longest running tests at top)
declare -a manual_tests=(
'ripple.ripple_data.reduce_relay_simulate'
'ripple.ripple_data.digest'
'ripple.tx.Offer_manual'
'ripple.app.PayStrandAllPairs'
Expand Down
15 changes: 7 additions & 8 deletions cfg/rippled-example.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,13 @@
#
#
#
# [max_transactions]
#
# Configure the maximum number of transactions to have in the job queue
#
# Must be a number between 100 and 1000, defaults to 250
#
#
# [overlay]
#
# Controls settings related to the peer to peer overlay.
Expand Down Expand Up @@ -506,14 +513,6 @@
# than the original transaction's fee, or meet the current open
# ledger fee to be considered. Default: 25.
#
# multi_txn_percent = <number>
#
# If a client submits multiple transactions (different sequence
# numbers), later transactions must pay a fee at least <number>
# percent higher than the transaction with the previous sequence
# number.
# Default: -90.
#
# minimum_escalation_multiplier = <number>
#
# At ledger close time, the median fee level of the transactions
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 @@ -157,7 +157,7 @@ RCLConsensus::Adaptor::share(RCLCxPeerPos const& peerPos)
auto const sig = peerPos.signature();
prop.set_signature(sig.data(), sig.size());

app_.overlay().relay(prop, peerPos.suppressionID());
app_.overlay().relay(prop, peerPos.suppressionID(), peerPos.publicKey());
}

void
Expand Down
13 changes: 6 additions & 7 deletions src/ripple/app/ledger/LedgerMaster.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,13 @@ class LedgerMaster : public Stoppable, public AbstractFetchPackContainer
void
applyHeldTransactions();

/** Get all the transactions held for a particular account.
This is normally called when a transaction for that
account is successfully applied to the open
ledger so those transactions can be resubmitted without
waiting for ledger close.
/** Get the next transaction held for a particular account if any.
This is normally called when a transaction for that account is
successfully applied to the open ledger so the next transaction
can be resubmitted without waiting for ledger close.
*/
std::vector<std::shared_ptr<STTx const>>
pruneHeldTransactions(AccountID const& account, std::uint32_t const seq);
std::shared_ptr<STTx const>
popAcctTransaction(std::shared_ptr<STTx const> const& tx);

/** Get a ledger's hash by sequence number using the cache
*/
Expand Down
8 changes: 3 additions & 5 deletions src/ripple/app/ledger/impl/LedgerMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,14 +543,12 @@ LedgerMaster::applyHeldTransactions()
mHeldTransactions.reset(app_.openLedger().current()->info().parentHash);
}

std::vector<std::shared_ptr<STTx const>>
LedgerMaster::pruneHeldTransactions(
AccountID const& account,
std::uint32_t const seq)
std::shared_ptr<STTx const>
LedgerMaster::popAcctTransaction(std::shared_ptr<STTx const> const& tx)
{
std::lock_guard sl(m_mutex);

return mHeldTransactions.prune(account, seq);
return mHeldTransactions.popAcctTransaction(tx);
}

LedgerIndex
Expand Down
15 changes: 6 additions & 9 deletions src/ripple/app/ledger/impl/LedgerToJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,12 @@ fillJsonQueue(Object& json, LedgerFill const& fill)
txJson[jss::fee_level] = to_string(tx.feeLevel);
if (tx.lastValid)
txJson[jss::LastLedgerSequence] = *tx.lastValid;
if (tx.consequences)
{
txJson[jss::fee] = to_string(tx.consequences->fee);
auto spend = tx.consequences->potentialSpend + tx.consequences->fee;
txJson[jss::max_spend_drops] = to_string(spend);
auto authChanged =
tx.consequences->category == TxConsequences::blocker;
txJson[jss::auth_change] = authChanged;
}

txJson[jss::fee] = to_string(tx.consequences.fee());
auto const spend =
tx.consequences.potentialSpend() + tx.consequences.fee();
txJson[jss::max_spend_drops] = to_string(spend);
txJson[jss::auth_change] = tx.consequences.isBlocker();

txJson[jss::account] = to_string(tx.account);
txJson["retries_remaining"] = tx.retriesRemaining;
Expand Down
36 changes: 26 additions & 10 deletions src/ripple/app/ledger/impl/LocalTxs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class LocalTx
, m_expire(index + holdLedgers)
, m_id(txn->getTransactionID())
, m_account(txn->getAccountID(sfAccount))
, m_seq(txn->getSequence())
, m_seqProxy(txn->getSeqProxy())
{
if (txn->isFieldPresent(sfLastLedgerSequence))
m_expire =
Expand All @@ -76,10 +76,10 @@ class LocalTx
return m_id;
}

std::uint32_t
getSeq() const
SeqProxy
getSeqProxy() const
{
return m_seq;
return m_seqProxy;
}

bool
Expand All @@ -105,7 +105,7 @@ class LocalTx
LedgerIndex m_expire;
uint256 m_id;
AccountID m_account;
std::uint32_t m_seq;
SeqProxy m_seqProxy;
};

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -138,7 +138,6 @@ class LocalTxsImp : public LocalTxs
for (auto const& it : m_txns)
tset.insert(it.getTX());
}

return tset;
}

Expand All @@ -156,11 +155,28 @@ class LocalTxsImp : public LocalTxs
if (view.txExists(txn.getID()))
return true;

std::shared_ptr<SLE const> sle =
view.read(keylet::account(txn.getAccount()));
if (!sle)
AccountID const acctID = txn.getAccount();
auto const sleAcct = view.read(keylet::account(acctID));

if (!sleAcct)
return false;
return sle->getFieldU32(sfSequence) > txn.getSeq();

SeqProxy const acctSeq =
SeqProxy::sequence(sleAcct->getFieldU32(sfSequence));
SeqProxy const seqProx = txn.getSeqProxy();

if (seqProx.isSeq())
return acctSeq > seqProx; // Remove tefPAST_SEQ

if (seqProx.isTicket() && acctSeq.value() <= seqProx.value())
// Keep ticket from the future. Note, however, that the
// transaction will not be held indefinitely since LocalTxs
// will only hold a transaction for a maximum of 5 ledgers.
return false;

// Ticket should have been created by now. Remove if ticket
// does not exist.
return !view.exists(keylet::ticket(acctID, seqProx));
});
}

Expand Down
Loading