Compare commits

...

59 Commits

Author SHA1 Message Date
Bart
520dafa13a Update Conan lock file 2025-11-22 09:20:49 -05:00
Bart
6012d6fbb6 Update Conan lock file 2025-11-21 16:45:58 -05:00
Bart
bb12fec302 Merge branch 'develop' into bthomee/proto 2025-11-21 11:47:54 -05:00
Pratik Mankawde
e4dccfd49b refactor: Retire DisallowIncoming amendment (#6045)
Amendments activated for more than 2 years can be retired. This change retires the DisallowIncoming amendment.
2025-11-21 15:18:00 +00:00
Jingchen
57f4b4eb7f refactor: Retire Checks amendment (#6055)
Amendments activated for more than 2 years can be retired. This change retires the Checks amendment.
2025-11-21 14:19:43 +00:00
Bart
a830081ede Merge branch 'develop' into bthomee/proto 2025-11-07 14:01:36 -05:00
Bart Thomee
f478467904 Merge branch 'develop' into bthomee/proto 2025-11-03 10:51:01 +00:00
Bart Thomee
91e1147cec Remove Conan profile override for grpc 2025-10-27 13:48:55 -04:00
Bart Thomee
0e7b1a29d9 Merge branch 'develop' into bthomee/proto 2025-10-27 13:47:09 -04:00
Bart Thomee
37742ebd85 Update m4 2025-10-17 14:29:00 -04:00
Bart Thomee
76593e00b6 Restore profile, using patched M4 recipe instead 2025-10-17 14:22:19 -04:00
Bart
e4a38fa11c Merge branch 'develop' into bthomee/proto 2025-10-17 13:12:36 -04:00
Bart Thomee
ccc0a45858 Override compiler.cppstd for M4 2025-10-16 09:00:33 -04:00
Bart Thomee
1125b25556 Override compiler.cppstd for M4 2025-10-16 08:55:33 -04:00
Bart Thomee
447dbf5e62 Merge branch 'develop' into bthomee/proto 2025-10-16 08:55:00 -04:00
Bart Thomee
4d3427e19c Merge branch 'develop' into bthomee/proto 2025-10-15 15:34:38 -04:00
Bart Thomee
3cf90aaf5f Temporarily use custom RHEL 9 docker image to test missing dependencies 2025-10-14 08:49:12 -04:00
Bart Thomee
c267000b32 Update conan.lock with Linux-only dependencies 2025-10-14 06:31:54 -04:00
Bart Thomee
a930e82684 Use updated protobuf 6.32.1 2025-10-13 17:25:45 -04:00
Bart Thomee
3b8c372075 Merge branch 'develop' into bthomee/proto 2025-10-13 16:10:53 -04:00
Bart Thomee
5467d3cbec Merge branch 'develop' into bthomee/proto 2025-09-26 19:53:02 +02:00
Bart Thomee
9c9362ae5a Merge branch 'develop' into bthomee/proto 2025-08-13 08:07:51 -04:00
Bart Thomee
a50fbcce01 Merge branch 'develop' into bthomee/proto 2025-08-06 11:52:23 -04:00
Bart Thomee
9844a53404 Fix commands in readme 2025-08-06 10:11:41 -04:00
Bart
b915e0cb4b Merge branch 'bthomee/external' into bthomee/proto 2025-08-06 08:44:02 -04:00
Bart Thomee
9d40f42500 Fix conflict 2025-08-06 08:42:38 -04:00
Bart Thomee
8985e8fce9 Merge branch 'develop' into bthomee/proto 2025-08-06 08:39:23 -04:00
Bart Thomee
6606676aeb Pull in latest changes 2025-08-06 08:35:57 -04:00
Bart Thomee
5fefc85d9b Fix link in documentation 2025-08-06 08:30:30 -04:00
Bart Thomee
df3df54806 Add instructions on how to fetch updated recipes from CCI fork 2025-08-06 06:35:35 -04:00
Bart Thomee
5ae0560829 Merge branch 'develop' into bthomee/external 2025-08-06 06:25:01 -04:00
Bart Thomee
b12eff90cb Merge branch 'develop' into bthomee/external 2025-08-05 15:49:40 -04:00
Bart Thomee
da7558a2e4 Merge branch 'develop' into bthomee/external 2025-08-04 10:56:24 -04:00
Bart Thomee
c301a86e8d Remove unnecessary section in readme 2025-08-03 14:55:32 -04:00
Bart Thomee
88361aa9ed Remove unnecessary authentication for read-only remote access, and update remote name 2025-08-02 13:01:23 -04:00
Bart Thomee
780963d5db Update Conan remote 2025-07-31 16:38:47 -04:00
Bart Thomee
2977cbb411 Remove external libraries hosted in our conan center index fork 2025-07-31 15:57:02 -04:00
Bart Thomee
a33ae199d9 Merge branch 'develop' into bthomee/proto 2025-07-31 15:50:07 -04:00
Bart Thomee
62f15223aa Enable codegen grpc plugin 2025-07-31 15:47:54 -04:00
Bart Thomee
2faa453ea7 Adds protobuf patches 2025-07-31 15:47:16 -04:00
Ayaz Salikhov
11d29572eb Revert "ci: Build all conan dependencies from source for now (#5623)" (#5639)
This reverts commit 9b45b6888b.
2025-07-31 15:39:55 -04:00
Bronek Kozicki
3c020b8827 Fix crash in Slot::deletePeer (#5635)
Fix crash due to recurrent call to `Slot::deletePeer` (via `OverlayImpl::unsquelch`) when a peer is disconnected at just the wrong moment.
2025-07-31 15:39:55 -04:00
Shawn Xie
1aec231cff fix DeliveredAmount and delivered_amount in transaction metadata for direct MPT transfer (#5569)
The Payment transaction metadata is missing the `DeliveredAmount` field that displays the actual amount delivered to the destination excluding transfer fees. This amendment fixes this problem.
2025-07-31 15:39:55 -04:00
Ayaz Salikhov
0970c52735 ci: Build all conan dependencies from source for now (#5623) 2025-07-31 15:39:55 -04:00
Bronek Kozicki
69194f97d5 Build options cleanup (#5581)
As we no longer support old compiler versions, we are bringing back some warnings by removing no longer relevant `-Wno-...` options.
2025-07-31 15:39:54 -04:00
Bart Thomee
8725e4c0f9 Switches Windows to use dynamic runtime 2025-07-25 14:28:08 -04:00
Bart Thomee
951eeb65f3 Merge branch 'develop' into bthomee/proto 2025-07-25 12:23:32 -04:00
Bart Thomee
343be83572 Enable codegen grpc plugin 2025-07-24 14:59:26 -04:00
Bart Thomee
0cbd52b939 Merge branch 'develop' into bthomee/proto 2025-07-24 14:54:14 -04:00
Bart Thomee
66c726556d Adds protobuf patches 2025-07-24 13:54:20 -04:00
Bart Thomee
8e93e204c7 Merge branch 'develop' into bthomee/proto 2025-07-24 13:48:34 -04:00
Bart Thomee
a9a99ebad1 Restore currently used image versions 2025-07-23 11:04:08 -04:00
Bart Thomee
95a8d84f1f Temporarily compile using Clang 17 2025-07-22 10:44:19 -04:00
Bart Thomee
5a2004332b Temporarily compile using Clang 17 2025-07-22 10:32:26 -04:00
Bart Thomee
9a56a5b788 Temporarily disable ripple remote 2025-07-21 17:45:16 -04:00
Bart Thomee
605c8bd377 Temporarily disable ripple remote 2025-07-21 17:10:19 -04:00
Bart Thomee
900131d09f Temporarily disable ripple remote 2025-07-21 16:36:24 -04:00
Bart Thomee
01bdb87b39 Explicitly specify version of abseil to use 2025-07-21 16:13:24 -04:00
Bart Thomee
274a7303ff Updates protobuf and grpc 2025-07-21 15:14:56 -04:00
20 changed files with 112 additions and 233 deletions

3
.gitignore vendored
View File

@@ -111,3 +111,6 @@ bld.rippled/
# Suggested in-tree build directory
/.build*/
# Locally patched Conan recipes
external/conan-center-index/

View File

@@ -135,16 +135,23 @@ locally:
```bash
cd external
mkdir -p conan-center-index
cd conan-center-index
git init
git remote add origin git@github.com:XRPLF/conan-center-index.git
git sparse-checkout init
git sparse-checkout set recipes/snappy
git sparse-checkout set recipes/grpc
git sparse-checkout add recipes/m4
git sparse-checkout add recipes/snappy
git sparse-checkout add recipes/soci
git fetch origin master
git checkout master
conan export --version 1.1.10 recipes/snappy/all
conan export --version 4.0.3 recipes/soci/all
rm -rf .git
cd ../..
conan export --version 1.72.0 external/conan-center-index/recipes/grpc/all
conan export --version 1.4.19 external/conan-center-index/recipes/m4/all
conan export --version 1.1.10 external/conan-center-index/recipes/snappy/all
conan export --version 4.0.3 external/conan-center-index/recipes/soci/all
```
In the case we switch to a newer version of a dependency that still requires a
@@ -373,19 +380,6 @@ tools.build:cxxflags=['-DBOOST_ASIO_DISABLE_CONCEPTS']
`--settings build_type=$BUILD_TYPE` or in the profile itself,
under the section `[settings]` with the key `build_type`.
If you are using a Microsoft Visual C++ compiler,
then you will need to ensure consistency between the `build_type` setting
and the `compiler.runtime` setting.
When `build_type` is `Release`, `compiler.runtime` should be `MT`.
When `build_type` is `Debug`, `compiler.runtime` should be `MTd`.
```
conan install .. --output-folder . --build missing --settings build_type=Release --settings compiler.runtime=MT
conan install .. --output-folder . --build missing --settings build_type=Debug --settings compiler.runtime=MTd
```
3. Configure CMake and pass the toolchain file generated by Conan, located at
`$OUTPUT_FOLDER/build/generators/conan_toolchain.cmake`.

View File

@@ -72,9 +72,9 @@ if (MSVC)
-GS
-Zc:forScope
>
# static runtime
$<$<CONFIG:Debug>:-MTd>
$<$<NOT:$<CONFIG:Debug>>:-MT>
# dynamic runtime
$<$<CONFIG:Debug>:-MDd>
$<$<NOT:$<CONFIG:Debug>>:-MD>
$<$<BOOL:${werr}>:-WX>
)
target_compile_definitions (common

View File

@@ -8,7 +8,7 @@
"snappy/1.1.10#968fef506ff261592ec30c574d4a7809%1756234314.246",
"rocksdb/10.5.1#4a197eca381a3e5ae8adf8cffa5aacd0%1762797952.535",
"re2/20230301#dfd6e2bf050eb90ddd8729cfb4c844a4%1756234257.976",
"protobuf/3.21.12#d927114e28de9f4691a6bbcdd9a529d1%1756234251.614",
"protobuf/6.32.1#f481fd276fc23a33b85a3ed1e898b693%1759134873.45",
"openssl/3.5.4#a1d5835cc6ed5c5b8f3cd5b9b5d24205%1760106486.594",
"nudb/2.0.9#fb8dfd1a5557f5e0528114c2da17721e%1763150366.909",
"lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504%1756234228.999",
@@ -16,31 +16,31 @@
"libbacktrace/cci.20210118#a7691bfccd8caaf66309df196790a5a1%1756230911.03",
"libarchive/3.8.1#5cf685686322e906cb42706ab7e099a8%1756234256.696",
"jemalloc/5.3.0#e951da9cf599e956cebc117880d2d9f8%1729241615.244",
"grpc/1.50.1#02291451d1e17200293a409410d1c4e1%1756234248.958",
"grpc/1.72.0#f244a57bff01e708c55a1100b12e1589%1763158050.628",
"doctest/2.4.12#eb9fb352fb2fdfc8abb17ec270945165%1762797941.757",
"date/3.0.4#f74bbba5a08fa388256688743136cb6f%1756234217.493",
"date/3.0.4#862e11e80030356b53c2c38599ceb32b%1763584497.32",
"c-ares/1.34.5#b78b91e7cfb1f11ce777a285bbf169c6%1756234217.915",
"bzip2/1.0.8#00b4a4658791c1f06914e087f0e792f5%1756234261.716",
"boost/1.88.0#8852c0b72ce8271fb8ff7c53456d4983%1756223752.326",
"abseil/20230802.1#f0f91485b111dc9837a68972cb19ca7b%1756234220.907"
"abseil/20250127.0#9e8e8cfc89a1324139fc0ee3bd4d8c8c%1753819045.301"
],
"build_requires": [
"zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76%1756234269.497",
"strawberryperl/5.32.1.1#707032463aa0620fa17ec0d887f5fe41%1756234281.733",
"protobuf/3.21.12#d927114e28de9f4691a6bbcdd9a529d1%1756234251.614",
"protobuf/6.32.1#f481fd276fc23a33b85a3ed1e898b693%1759134873.45",
"nasm/2.16.01#31e26f2ee3c4346ecd347911bd126904%1756234232.901",
"msys2/cci.latest#5b73b10144f73cc5bfe0572ed9be39e1%1751977009.857",
"m4/1.4.19#f119296e5c4772b3bb7ab060ae8f417b%1760707875.678",
"m4/1.4.19#70dc8bbb33e981d119d2acc0175cf381%1763158052.846",
"cmake/3.31.8#dde3bde00bb843687e55aea5afa0e220%1756234232.89",
"b2/5.3.3#107c15377719889654eb9a162a673975%1756234226.28",
"automake/1.16.5#b91b7c384c3deaa9d535be02da14d04f%1755524470.56",
"autoconf/2.71#51077f068e61700d65bb05541ea1e4b0%1731054366.86"
"autoconf/2.71#51077f068e61700d65bb05541ea1e4b0%1731054366.86",
"abseil/20250127.0#9e8e8cfc89a1324139fc0ee3bd4d8c8c%1753819045.301"
],
"python_requires": [],
"overrides": {
"protobuf/3.21.12": [
null,
"protobuf/3.21.12"
"protobuf/5.27.0": [
"protobuf/6.32.1"
],
"lz4/1.9.4": [
"lz4/1.10.0"
@@ -48,14 +48,11 @@
"boost/1.83.0": [
"boost/1.88.0"
],
"sqlite3/[>=3.44 <4]": [
"sqlite3/3.44.2": [
"sqlite3/3.49.1"
],
"lz4/[>=1.9.4 <2]": [
"lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504"
],
"sqlite3/3.44.2": [
"sqlite3/3.49.1"
]
},
"config_requires": []

View File

@@ -14,18 +14,12 @@ compiler={{compiler}}
compiler.version={{ compiler_version }}
compiler.cppstd=20
{% if os == "Windows" %}
compiler.runtime=static
compiler.runtime=dynamic
{% else %}
compiler.libcxx={{detect_api.detect_libcxx(compiler, version, compiler_exe)}}
{% endif %}
[conf]
{% if compiler == "clang" and compiler_version >= 19 %}
grpc/1.50.1:tools.build:cxxflags+=['-Wno-missing-template-arg-list-after-template-kw']
{% endif %}
{% if compiler == "apple-clang" and compiler_version >= 17 %}
grpc/1.50.1:tools.build:cxxflags+=['-Wno-missing-template-arg-list-after-template-kw']
{% endif %}
{% if compiler == "gcc" and compiler_version < 13 %}
tools.build:cxxflags+=['-Wno-restrict']
{% endif %}

View File

@@ -24,7 +24,7 @@ class Xrpl(ConanFile):
}
requires = [
'grpc/1.50.1',
'grpc/1.72.0',
'libarchive/3.8.1',
'nudb/2.0.9',
'openssl/3.5.4',
@@ -37,7 +37,7 @@ class Xrpl(ConanFile):
]
tool_requires = [
'protobuf/3.21.12',
'protobuf/6.32.1',
]
default_options = {
@@ -55,6 +55,16 @@ class Xrpl(ConanFile):
'date/*:header_only': True,
'grpc/*:shared': False,
'grpc/*:secure': True,
'grpc/*:codegen': True,
'grpc/*:cpp_plugin': True,
'grpc/*:csharp_ext': False,
'grpc/*:csharp_plugin': False,
'grpc/*:node_plugin': False,
'grpc/*:objective_c_plugin': False,
'grpc/*:php_plugin': False,
'grpc/*:python_plugin': False,
'grpc/*:ruby_plugin': False,
'grpc/*:otel_plugin': False,
'libarchive/*:shared': False,
'libarchive/*:with_acl': False,
'libarchive/*:with_bzip2': False,
@@ -109,7 +119,7 @@ class Xrpl(ConanFile):
self.requires('boost/1.88.0', force=True, **transitive_headers_opt)
self.requires('date/3.0.4', **transitive_headers_opt)
self.requires('lz4/1.10.0', force=True)
self.requires('protobuf/3.21.12', force=True)
self.requires('protobuf/6.32.1', force=True)
self.requires('sqlite3/3.49.1', force=True)
if self.options.jemalloc:
self.requires('jemalloc/5.3.0')

View File

@@ -63,12 +63,10 @@ XRPL_FEATURE(AMM, Supported::yes, VoteBehavior::DefaultNo
XRPL_FEATURE(Clawback, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (UniversalNumber, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(XRPFees, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(DisallowIncoming, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (RemoveNFTokenAutoTrustLine, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(FlowSortStrands, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(RequireFullyCanonicalSig, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(DeletableAccounts, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(Checks, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(Flow, Supported::yes, VoteBehavior::DefaultYes)
// The following amendments are obsolete, but must remain supported
@@ -116,10 +114,12 @@ XRPL_RETIRE_FIX(STAmountCanonicalize)
XRPL_RETIRE_FIX(TakerDryOfferRemoval)
XRPL_RETIRE_FIX(TrustLinesToSelf)
XRPL_RETIRE_FEATURE(Checks)
XRPL_RETIRE_FEATURE(CheckCashMakesTrustLine)
XRPL_RETIRE_FEATURE(CryptoConditions)
XRPL_RETIRE_FEATURE(DepositAuth)
XRPL_RETIRE_FEATURE(DepositPreauth)
XRPL_RETIRE_FEATURE(DisallowIncoming)
XRPL_RETIRE_FEATURE(Escrow)
XRPL_RETIRE_FEATURE(EnforceInvariants)
XRPL_RETIRE_FEATURE(ExpandedSignerList)

View File

@@ -226,7 +226,7 @@ TRANSACTION(ttPAYCHAN_CLAIM, 15, PaymentChannelClaim,
#endif
TRANSACTION(ttCHECK_CREATE, 16, CheckCreate,
Delegation::delegatable,
featureChecks,
uint256{},
noPriv,
({
{sfDestination, soeREQUIRED},
@@ -242,7 +242,7 @@ TRANSACTION(ttCHECK_CREATE, 16, CheckCreate,
#endif
TRANSACTION(ttCHECK_CASH, 17, CheckCash,
Delegation::delegatable,
featureChecks,
uint256{},
noPriv,
({
{sfCheckID, soeREQUIRED},
@@ -256,7 +256,7 @@ TRANSACTION(ttCHECK_CASH, 17, CheckCash,
#endif
TRANSACTION(ttCHECK_CANCEL, 18, CheckCancel,
Delegation::delegatable,
featureChecks,
uint256{},
noPriv,
({
{sfCheckID, soeREQUIRED},

View File

@@ -67,8 +67,6 @@ public:
class Check_test : public beast::unit_test::suite
{
FeatureBitset const disallowIncoming{featureDisallowIncoming};
static uint256
getCheckIndex(AccountID const& account, std::uint32_t uSequence)
{
@@ -125,25 +123,6 @@ class Check_test : public beast::unit_test::suite
using namespace test::jtx;
Account const alice{"alice"};
{
// If the Checks amendment is not enabled, you should not be able
// to create, cash, or cancel checks.
Env env{*this, features - featureChecks};
env.fund(XRP(1000), alice);
env.close();
uint256 const checkId{
getCheckIndex(env.master, env.seq(env.master))};
env(check::create(env.master, alice, XRP(100)), ter(temDISABLED));
env.close();
env(check::cash(alice, checkId, XRP(100)), ter(temDISABLED));
env.close();
env(check::cancel(alice, checkId), ter(temDISABLED));
env.close();
}
{
// If the Checks amendment is enabled all check-related
// facilities should be available.
@@ -277,24 +256,12 @@ class Check_test : public beast::unit_test::suite
using namespace test::jtx;
// test flag doesn't set unless amendment enabled
{
Env env{*this, features - disallowIncoming};
Account const alice{"alice"};
env.fund(XRP(10000), alice);
env(fset(alice, asfDisallowIncomingCheck));
env.close();
auto const sle = env.le(alice);
uint32_t flags = sle->getFlags();
BEAST_EXPECT(!(flags & lsfDisallowIncomingCheck));
}
Account const gw{"gateway"};
Account const alice{"alice"};
Account const bob{"bob"};
IOU const USD{gw["USD"]};
Env env{*this, features | disallowIncoming};
Env env{*this, features};
STAmount const startBalance{XRP(1000).value()};
env.fund(startBalance, gw, alice, bob);
@@ -2613,7 +2580,6 @@ public:
{
using namespace test::jtx;
auto const sa = testable_amendments();
testWithFeats(sa - disallowIncoming);
testWithFeats(sa);
testTrustLineCreation(sa);
}

View File

@@ -1703,9 +1703,6 @@ class Delegate_test : public beast::unit_test::suite
// NFTokenMint, NFTokenBurn, NFTokenCreateOffer, NFTokenCancelOffer,
// NFTokenAcceptOffer are not included, they are tested separately.
std::unordered_map<std::string, uint256> txRequiredFeatures{
{"CheckCreate", featureChecks},
{"CheckCash", featureChecks},
{"CheckCancel", featureChecks},
{"Clawback", featureClawback},
{"AMMClawback", featureAMMClawback},
{"AMMCreate", featureAMM},

View File

@@ -12,8 +12,6 @@ namespace ripple {
class NFTokenBaseUtil_test : public beast::unit_test::suite
{
FeatureBitset const disallowIncoming{featureDisallowIncoming};
// Helper function that returns the number of NFTs minted by an issuer.
static std::uint32_t
mintedCount(test::jtx::Env const& env, test::jtx::Account const& issuer)
@@ -2960,19 +2958,7 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite
using namespace test::jtx;
// test flag doesn't set unless amendment enabled
{
Env env{*this, features - disallowIncoming};
Account const alice{"alice"};
env.fund(XRP(10000), alice);
env(fset(alice, asfDisallowIncomingNFTokenOffer));
env.close();
auto const sle = env.le(alice);
uint32_t flags = sle->getFlags();
BEAST_EXPECT(!(flags & lsfDisallowIncomingNFTokenOffer));
}
Env env{*this, features | disallowIncoming};
Env env{*this, features};
Account const issuer{"issuer"};
Account const minter{"minter"};
@@ -7624,8 +7610,8 @@ class NFTokenDisallowIncoming_test : public NFTokenBaseUtil_test
run() override
{
testWithFeats(
allFeatures - featureDisallowIncoming - fixNFTokenReserve -
featureNFTokenMintOffer - featureDynamicNFT);
allFeatures - fixNFTokenReserve - featureNFTokenMintOffer -
featureDynamicNFT);
}
};

View File

@@ -14,8 +14,6 @@ using namespace jtx::paychan;
struct PayChan_test : public beast::unit_test::suite
{
FeatureBitset const disallowIncoming{featureDisallowIncoming};
static std::pair<uint256, std::shared_ptr<SLE const>>
channelKeyAndSle(
ReadView const& view,
@@ -242,20 +240,8 @@ struct PayChan_test : public beast::unit_test::suite
testcase("Disallow Incoming Flag");
using namespace jtx;
// test flag doesn't set unless amendment enabled
{
Env env{*this, features - disallowIncoming};
Account const alice{"alice"};
env.fund(XRP(10000), alice);
env(fset(alice, asfDisallowIncomingPayChan));
env.close();
auto const sle = env.le(alice);
uint32_t flags = sle->getFlags();
BEAST_EXPECT(!(flags & lsfDisallowIncomingPayChan));
}
using namespace std::literals::chrono_literals;
Env env{*this, features | disallowIncoming};
Env env{*this, features};
auto const alice = Account("alice");
auto const bob = Account("bob");
auto const cho = Account("cho");
@@ -2127,7 +2113,6 @@ public:
{
using namespace test::jtx;
FeatureBitset const all{testable_amendments()};
testWithFeats(all - disallowIncoming);
testWithFeats(all);
testDepositAuthCreds();
testMetaAndOwnership(all - fixIncludeKeyletFields);

View File

@@ -9,8 +9,6 @@ namespace test {
class SetTrust_test : public beast::unit_test::suite
{
FeatureBitset const disallowIncoming{featureDisallowIncoming};
public:
void
testTrustLineDelete()
@@ -478,25 +476,12 @@ public:
using namespace test::jtx;
// test flag doesn't set unless amendment enabled
{
Env env{*this, features - disallowIncoming};
Account const alice{"alice"};
env.fund(XRP(10000), alice);
env(fset(alice, asfDisallowIncomingTrustline));
env.close();
auto const sle = env.le(alice);
uint32_t flags = sle->getFlags();
BEAST_EXPECT(!(flags & lsfDisallowIncomingTrustline));
}
// fixDisallowIncomingV1
{
for (bool const withFix : {true, false})
{
auto const amend = withFix
? features | disallowIncoming
: (features | disallowIncoming) - fixDisallowIncomingV1;
auto const amend =
withFix ? features : features - fixDisallowIncomingV1;
Env env{*this, amend};
auto const dist = Account("dist");
@@ -532,7 +517,7 @@ public:
}
}
Env env{*this, features | disallowIncoming};
Env env{*this, features};
auto const gw = Account{"gateway"};
auto const alice = Account{"alice"};
@@ -630,7 +615,6 @@ public:
{
using namespace test::jtx;
auto const sa = testable_amendments();
testWithFeats(sa - disallowIncoming);
testWithFeats(sa);
}
};

View File

@@ -615,33 +615,23 @@ public:
{"disallowIncomingTrustline",
asfDisallowIncomingTrustline}}};
if (features[featureDisallowIncoming])
for (auto& asf : disallowIncomingFlags)
{
for (auto& asf : disallowIncomingFlags)
{
// Clear a flag and check that account_info returns results
// as expected
env(fclear(alice, asf.second));
env.close();
auto const f1 = getAccountFlag(asf.first, alice);
BEAST_EXPECT(f1.has_value());
BEAST_EXPECT(!f1.value());
// Clear a flag and check that account_info returns results
// as expected
env(fclear(alice, asf.second));
env.close();
auto const f1 = getAccountFlag(asf.first, alice);
BEAST_EXPECT(f1.has_value());
BEAST_EXPECT(!f1.value());
// Set a flag and check that account_info returns results
// as expected
env(fset(alice, asf.second));
env.close();
auto const f2 = getAccountFlag(asf.first, alice);
BEAST_EXPECT(f2.has_value());
BEAST_EXPECT(f2.value());
}
}
else
{
for (auto& asf : disallowIncomingFlags)
{
BEAST_EXPECT(!getAccountFlag(asf.first, alice));
}
// Set a flag and check that account_info returns results
// as expected
env(fset(alice, asf.second));
env.close();
auto const f2 = getAccountFlag(asf.first, alice);
BEAST_EXPECT(f2.has_value());
BEAST_EXPECT(f2.value());
}
static constexpr std::pair<std::string_view, std::uint32_t>
@@ -706,12 +696,8 @@ public:
FeatureBitset const allFeatures{
ripple::test::jtx::testable_amendments()};
testAccountFlags(allFeatures);
testAccountFlags(allFeatures - featureDisallowIncoming);
testAccountFlags(
allFeatures - featureDisallowIncoming - featureClawback);
testAccountFlags(
allFeatures - featureDisallowIncoming - featureClawback -
featureTokenEscrow);
testAccountFlags(allFeatures - featureClawback);
testAccountFlags(allFeatures - featureClawback - featureTokenEscrow);
}
};

View File

@@ -61,8 +61,7 @@ CreateCheck::preclaim(PreclaimContext const& ctx)
auto const flags = sleDst->getFlags();
// Check if the destination has disallowed incoming checks
if (ctx.view.rules().enabled(featureDisallowIncoming) &&
(flags & lsfDisallowIncomingCheck))
if (flags & lsfDisallowIncomingCheck)
return tecNO_PERMISSION;
// Pseudo-accounts cannot cash checks. Note, this is not amendment-gated

View File

@@ -919,31 +919,21 @@ tokenOfferCreatePreclaim(
return tecNO_DST;
// check if the destination has disallowed incoming offers
if (view.rules().enabled(featureDisallowIncoming))
{
// flag cannot be set unless amendment is enabled but
// out of an abundance of caution check anyway
if (sleDst->getFlags() & lsfDisallowIncomingNFTokenOffer)
return tecNO_PERMISSION;
}
if (sleDst->getFlags() & lsfDisallowIncomingNFTokenOffer)
return tecNO_PERMISSION;
}
if (owner)
{
// Check if the owner (buy offer) has disallowed incoming offers
if (view.rules().enabled(featureDisallowIncoming))
{
auto const sleOwner = view.read(keylet::account(*owner));
auto const sleOwner = view.read(keylet::account(*owner));
// defensively check
// it should not be possible to specify owner that doesn't exist
if (!sleOwner)
return tecNO_TARGET;
// defensively check
// it should not be possible to specify owner that doesn't exist
if (!sleOwner)
return tecNO_TARGET;
if (sleOwner->getFlags() & lsfDisallowIncomingNFTokenOffer)
return tecNO_PERMISSION;
}
if (sleOwner->getFlags() & lsfDisallowIncomingNFTokenOffer)
return tecNO_PERMISSION;
}
if (view.rules().enabled(fixEnforceNFTokenTrustlineV2) && !amount.native())

View File

@@ -202,8 +202,7 @@ PayChanCreate::preclaim(PreclaimContext const& ctx)
auto const flags = sled->getFlags();
// Check if they have disallowed incoming payment channels
if (ctx.view.rules().enabled(featureDisallowIncoming) &&
(flags & lsfDisallowIncomingPayChan))
if (flags & lsfDisallowIncomingPayChan)
return tecNO_PERMISSION;
if ((flags & lsfRequireDestTag) && !ctx.tx[~sfDestinationTag])

View File

@@ -595,29 +595,25 @@ SetAccount::doApply()
sle->isFieldPresent(sfNFTokenMinter))
sle->makeFieldAbsent(sfNFTokenMinter);
// Set or clear flags for disallowing various incoming instruments
if (ctx_.view().rules().enabled(featureDisallowIncoming))
{
if (uSetFlag == asfDisallowIncomingNFTokenOffer)
uFlagsOut |= lsfDisallowIncomingNFTokenOffer;
else if (uClearFlag == asfDisallowIncomingNFTokenOffer)
uFlagsOut &= ~lsfDisallowIncomingNFTokenOffer;
if (uSetFlag == asfDisallowIncomingNFTokenOffer)
uFlagsOut |= lsfDisallowIncomingNFTokenOffer;
else if (uClearFlag == asfDisallowIncomingNFTokenOffer)
uFlagsOut &= ~lsfDisallowIncomingNFTokenOffer;
if (uSetFlag == asfDisallowIncomingCheck)
uFlagsOut |= lsfDisallowIncomingCheck;
else if (uClearFlag == asfDisallowIncomingCheck)
uFlagsOut &= ~lsfDisallowIncomingCheck;
if (uSetFlag == asfDisallowIncomingCheck)
uFlagsOut |= lsfDisallowIncomingCheck;
else if (uClearFlag == asfDisallowIncomingCheck)
uFlagsOut &= ~lsfDisallowIncomingCheck;
if (uSetFlag == asfDisallowIncomingPayChan)
uFlagsOut |= lsfDisallowIncomingPayChan;
else if (uClearFlag == asfDisallowIncomingPayChan)
uFlagsOut &= ~lsfDisallowIncomingPayChan;
if (uSetFlag == asfDisallowIncomingPayChan)
uFlagsOut |= lsfDisallowIncomingPayChan;
else if (uClearFlag == asfDisallowIncomingPayChan)
uFlagsOut &= ~lsfDisallowIncomingPayChan;
if (uSetFlag == asfDisallowIncomingTrustline)
uFlagsOut |= lsfDisallowIncomingTrustline;
else if (uClearFlag == asfDisallowIncomingTrustline)
uFlagsOut &= ~lsfDisallowIncomingTrustline;
}
if (uSetFlag == asfDisallowIncomingTrustline)
uFlagsOut |= lsfDisallowIncomingTrustline;
else if (uClearFlag == asfDisallowIncomingTrustline)
uFlagsOut &= ~lsfDisallowIncomingTrustline;
// Set or clear flags for disallowing escrow
if (ctx_.view().rules().enabled(featureTokenEscrow))

View File

@@ -200,31 +200,27 @@ SetTrust::preclaim(PreclaimContext const& ctx)
// This might be nullptr
auto const sleDst = ctx.view.read(keylet::account(uDstAccountID));
if ((ctx.view.rules().enabled(featureDisallowIncoming) ||
ammEnabled(ctx.view.rules()) ||
if ((ammEnabled(ctx.view.rules()) ||
ctx.view.rules().enabled(featureSingleAssetVault)) &&
sleDst == nullptr)
return tecNO_DST;
// If the destination has opted to disallow incoming trustlines
// then honour that flag
if (ctx.view.rules().enabled(featureDisallowIncoming))
if (sleDst->getFlags() & lsfDisallowIncomingTrustline)
{
if (sleDst->getFlags() & lsfDisallowIncomingTrustline)
// The original implementation of featureDisallowIncoming was
// too restrictive. If
// o fixDisallowIncomingV1 is enabled and
// o The trust line already exists
// Then allow the TrustSet.
if (ctx.view.rules().enabled(fixDisallowIncomingV1) &&
ctx.view.exists(keylet::line(id, uDstAccountID, currency)))
{
// The original implementation of featureDisallowIncoming was
// too restrictive. If
// o fixDisallowIncomingV1 is enabled and
// o The trust line already exists
// Then allow the TrustSet.
if (ctx.view.rules().enabled(fixDisallowIncomingV1) &&
ctx.view.exists(keylet::line(id, uDstAccountID, currency)))
{
// pass
}
else
return tecNO_PERMISSION;
// pass
}
else
return tecNO_PERMISSION;
}
// In general, trust lines to pseudo accounts are not permitted, unless

View File

@@ -116,11 +116,8 @@ doAccountInfo(RPC::JsonContext& context)
for (auto const& lsf : lsFlags)
acctFlags[lsf.first.data()] = sleAccepted->isFlag(lsf.second);
if (ledger->rules().enabled(featureDisallowIncoming))
{
for (auto const& lsf : disallowIncomingFlags)
acctFlags[lsf.first.data()] = sleAccepted->isFlag(lsf.second);
}
for (auto const& lsf : disallowIncomingFlags)
acctFlags[lsf.first.data()] = sleAccepted->isFlag(lsf.second);
if (ledger->rules().enabled(featureClawback))
acctFlags[allowTrustLineClawbackFlag.first.data()] =