Compare commits

..

44 Commits

Author SHA1 Message Date
Richard Holland
6b49032436 feature count 2025-04-15 20:19:44 +10:00
RichardAH
7a62559da9 Merge branch 'dev' into remarks 2025-04-15 20:09:33 +10:00
Denis Angell
d7dd6196e8 fix test 2025-04-15 11:06:56 +02:00
Richard Holland
d3cfd46af3 add 1 to feature count 2025-04-15 17:15:40 +10:00
Richard Holland
94fab7d58b tx flags 2025-04-15 14:36:07 +10:00
Richard Holland
53b3b543a7 cleanup 2025-04-15 14:14:07 +10:00
Richard Holland
69e72ecb91 ensure numerically 0 value blob isnt a deletion 2025-04-15 13:59:42 +10:00
Richard Holland
98a33d11e0 change tem code 2025-04-15 13:54:59 +10:00
Richard Holland
c908018647 re-order check 2025-04-15 13:51:45 +10:00
RichardAH
c6ddd6d2c4 Merge branch 'dev' into remarks 2025-04-15 13:42:28 +10:00
RichardAH
78906ee086 Merge branch 'dev' into remarks 2025-04-09 17:14:04 +10:00
RichardAH
987247ddc1 Merge branch 'dev' into remarks 2024-11-20 12:15:32 +10:00
RichardAH
a5e2fd0699 Merge branch 'dev' into remarks 2024-11-09 15:27:55 +10:00
RichardAH
d92403ce35 Merge branch 'dev' into remarks 2024-11-09 13:45:31 +10:00
Denis Angell
6fb8fef883 clang-format 2024-09-19 16:29:18 +02:00
Denis Angell
a8a4774232 add tests 2024-09-19 16:27:33 +02:00
Denis Angell
eaec08471b Merge branch 'dev' into remarks 2024-09-19 14:41:53 +02:00
Denis Angell
caffeea6fc Merge branch 'dev' into remarks 2024-07-08 09:59:26 +02:00
Denis Angell
23d49d0548 Merge branch 'dev' into remarks 2024-05-23 08:23:54 +02:00
Denis Angell
519ab34e4f add more tests 2024-04-03 15:28:23 +02:00
Denis Angell
bdc59ac4ec apply sandbox and fixup 2024-04-03 15:28:07 +02:00
Denis Angell
96bb67bfe5 clang-format 2024-04-02 17:12:59 +02:00
Denis Angell
798212f87c add tests 2024-04-02 17:08:46 +02:00
Denis Angell
a3d61c0fbf make sfRemarkValue Optional 2024-04-02 16:55:31 +02:00
Denis Angell
3e926c9946 add remark fee 2024-04-02 16:55:15 +02:00
Denis Angell
4392342c99 update error warning 2024-04-02 16:54:47 +02:00
Denis Angell
f4fe7b7d9a add jtx helper 2024-04-02 16:53:33 +02:00
Richard Holland
d268638a39 whoops 2024-03-27 03:36:01 +00:00
Richard Holland
b1447afcc0 refactor, feature enable check 2024-03-27 02:22:02 +00:00
Denis Angell
f40621c662 Update mulDiv.cpp 2024-03-25 22:18:01 +01:00
Denis Angell
36ff48474a Revert "fix muldiv"
This reverts commit 63b0245d06.
2024-03-25 22:05:09 +01:00
Denis Angell
2adc234bf1 Update SetRemarks_test.cpp 2024-03-25 17:39:43 +01:00
Denis Angell
89bcacca5b use sandbox and peak 2024-03-25 17:30:26 +01:00
Denis Angell
6d496cc16f create set remarks test 2024-03-25 17:06:51 +01:00
Denis Angell
63b0245d06 fix muldiv 2024-03-25 17:06:39 +01:00
Denis Angell
fdf02a3853 Update SetRemarks.cpp 2024-03-25 17:06:32 +01:00
Denis Angell
9edf7ae67a create SetRemarks header 2024-03-25 17:06:29 +01:00
Denis Angell
533ba7ab75 nit: remit headerfile 2024-03-25 17:05:37 +01:00
Denis Angell
4e10d7d61f fix applySteps headers 2024-03-25 17:05:25 +01:00
Denis Angell
01e7caa0d6 fix applyHook headers 2024-03-25 17:05:15 +01:00
Denis Angell
349f4d2d68 reorder cmake 2024-03-25 17:05:04 +01:00
Richard Holland
24ac5d5f51 bug fixes, but levelisation issues 2024-03-25 06:58:31 +00:00
Richard Holland
8522c6684b transactor 2024-03-25 00:55:42 +00:00
Richard Holland
7efc26a8b1 initial version of remarks 2024-03-25 00:54:08 +00:00
9 changed files with 46 additions and 31 deletions

View File

@@ -4,32 +4,21 @@ on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
env:
CLANG_VERSION: 10
steps:
- uses: actions/checkout@v3
# - name: Install clang-format
# run: |
# codename=$( lsb_release --codename --short )
# sudo tee /etc/apt/sources.list.d/llvm.list >/dev/null <<EOF
# deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${CLANG_VERSION} main
# deb-src http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${CLANG_VERSION} main
# EOF
# wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add
# sudo apt-get update -y
# sudo apt-get install -y clang-format-${CLANG_VERSION}
# Temporary fix until this commit is merged
# https://github.com/XRPLF/rippled/commit/552377c76f55b403a1c876df873a23d780fcc81c
- name: Download and install clang-format
- name: Install clang-format
run: |
sudo apt-get update -y
sudo apt-get install -y libtinfo5
curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/clang+llvm-10.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz
tar -xf clang+llvm-10.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz
sudo mv clang+llvm-10.0.1-x86_64-linux-gnu-ubuntu-16.04 /opt/clang-10
sudo ln -s /opt/clang-10/bin/clang-format /usr/local/bin/clang-format-10
codename=$( lsb_release --codename --short )
sudo tee /etc/apt/sources.list.d/llvm.list >/dev/null <<EOF
deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${CLANG_VERSION} main
deb-src http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${CLANG_VERSION} main
EOF
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add
sudo apt-get update
sudo apt-get install clang-format-${CLANG_VERSION}
- name: Format src/ripple
run: find src/ripple -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.ipp' \) -print0 | xargs -0 clang-format-${CLANG_VERSION} -i
- name: Format src/test

View File

@@ -498,11 +498,15 @@ RCLConsensus::Adaptor::doAccept(
for (auto const& item : *result.txns.map_)
{
#ifndef DEBUG
try
{
#endif
retriableTxs.insert(
std::make_shared<STTx const>(SerialIter{item.slice()}));
JLOG(j_.debug()) << " Tx: " << item.key();
#ifndef DEBUG
}
catch (std::exception const& ex)
{
@@ -510,6 +514,7 @@ RCLConsensus::Adaptor::doAccept(
JLOG(j_.warn())
<< " Tx: " << item.key() << " throws: " << ex.what();
}
#endif
}
auto built = buildLCL(

View File

@@ -116,8 +116,10 @@ applyTransactions(
{
auto const txid = it->first.getTXID();
#ifndef DEBUG
try
{
#endif
if (pass == 0 && built->txExists(txid))
{
it = txns.erase(it);
@@ -140,6 +142,7 @@ applyTransactions(
case ApplyResult::Retry:
++it;
}
#ifndef DEBUG
}
catch (std::exception const& ex)
{
@@ -148,6 +151,7 @@ applyTransactions(
failed.insert(txid);
it = txns.erase(it);
}
#endif
}
JLOG(j.debug()) << (certainRetry ? "Pass: " : "Final pass: ") << pass

View File

@@ -44,7 +44,8 @@ convertBlobsToTxResult(
auto tr = std::make_shared<Transaction>(txn, reason, app);
auto metaset = std::make_shared<TxMeta>(tr->getID(), ledger_index, rawMeta);
auto metaset =
std::make_shared<TxMeta>(tr->getID(), tr->getLedger(), rawMeta);
// if properly formed meta is available we can use it to generate ctid
if (metaset->getAsObject().isFieldPresent(sfTransactionIndex))

View File

@@ -25,7 +25,6 @@
#include <ripple/protocol/Indexes.h>
#include <ripple/protocol/PublicKey.h>
#include <ripple/protocol/Quality.h>
#include <ripple/protocol/TxFlags.h>
#include <ripple/protocol/st.h>
namespace ripple {
@@ -314,21 +313,22 @@ SetRemarks::preclaim(PreclaimContext const& ctx)
TER
SetRemarks::doApply()
{
auto j = ctx_.journal;
Sandbox sb(&ctx_.view());
auto const sle = sb.read(keylet::account(account_));
if (!sle)
return tefINTERNAL;
return terNO_ACCOUNT;
auto const objID = ctx_.tx[sfObjectID];
auto sleO = sb.peek(keylet::unchecked(objID));
if (!sleO)
return tefINTERNAL;
return terNO_ACCOUNT;
std::optional<AccountID> issuer = getRemarksIssuer(sleO);
if (!issuer || *issuer != account_)
return tefINTERNAL;
return tecNO_PERMISSION;
auto const& remarksTxn = ctx_.tx.getFieldArray(sfRemarks);
@@ -400,7 +400,7 @@ SetRemarks::doApply()
}
if (newRemarks.size() > 32)
return tefINTERNAL;
return tecTOO_MANY_REMARKS;
if (newRemarks.empty() && sleO->isFieldPresent(sfRemarks))
sleO->makeFieldAbsent(sfRemarks);

View File

@@ -168,8 +168,10 @@ applyTransaction(
JLOG(j.debug()) << "TXN " << txn.getTransactionID()
<< (retryAssured ? "/retry" : "/final");
#ifndef DEBUG
try
{
#endif
auto const result = apply(app, view, txn, flags, j);
if (result.second)
{
@@ -189,12 +191,14 @@ applyTransaction(
JLOG(j.debug()) << "Transaction retry: " << transHuman(result.first);
return ApplyResult::Retry;
#ifndef DEBUG
}
catch (std::exception const& ex)
{
JLOG(j.warn()) << "Throws: " << ex.what();
return ApplyResult::Fail;
}
#endif
}
} // namespace ripple

View File

@@ -591,15 +591,19 @@ preflight(
{
PreflightContext const pfctx(app, tx, rules, flags, j);
#ifndef DEBUG
try
{
#endif
return {pfctx, invoke_preflight(pfctx)};
#ifndef DEBUG
}
catch (std::exception const& e)
{
JLOG(j.fatal()) << "apply: " << e.what();
return {pfctx, {tefEXCEPTION, TxConsequences{tx}}};
}
#endif
}
PreclaimResult
@@ -636,17 +640,21 @@ preclaim(
preflightResult.j);
}
#ifndef DEBUG
try
{
#endif
if (!isTesSuccess(ctx->preflightResult))
return {*ctx, ctx->preflightResult};
return {*ctx, invoke_preclaim(*ctx)};
#ifndef DEBUG
}
catch (std::exception const& e)
{
JLOG(ctx->j.fatal()) << "apply: " << e.what();
return {*ctx, tefEXCEPTION};
}
#endif
}
XRPAmount
@@ -670,8 +678,10 @@ doApply(PreclaimResult const& preclaimResult, Application& app, OpenView& view)
// info to recover.
return {tefEXCEPTION, false};
}
#ifndef DEBUG
try
{
#endif
if (!preclaimResult.likelyToClaimFee)
return {preclaimResult.ter, false};
@@ -684,12 +694,14 @@ doApply(PreclaimResult const& preclaimResult, Application& app, OpenView& view)
preclaimResult.flags,
preclaimResult.j);
return invoke_apply(ctx);
#ifndef DEBUG
}
catch (std::exception const& e)
{
JLOG(preclaimResult.j.fatal()) << "apply: " << e.what();
return {tefEXCEPTION, false};
}
#endif
}
} // namespace ripple

View File

@@ -396,8 +396,6 @@ private:
return "SetRegularKey";
if (inp == "HookSet")
return "SetHook";
if (inp == "RemarksSet")
return "SetRemarks";
return inp;
};

View File

@@ -377,8 +377,10 @@ struct SetRemarks_test : public beast::unit_test::suite
//----------------------------------------------------------------------
// doApply
// All checks in doApply are done in preclaim.
BEAST_EXPECT(1);
// terNO_ACCOUNT
// tecNO_TARGET
// tecNO_PERMISSION
// tecTOO_MANY_REMARKS
}
void