From fdd3612614930e7195c4f4f9ec1d438824608990 Mon Sep 17 00:00:00 2001 From: Alloy Networks <45832257+alloynetworks@users.noreply.github.com> Date: Tue, 25 Oct 2022 18:22:38 +0300 Subject: [PATCH 1/2] Reduce default reserves Reduce the reserve requirements from 20/5 to 10/2 in line with the current network votes. The requirements of 10/2 have been on the network long enough that new nodes should not still have the old reserve amount. --- src/ripple/app/misc/FeeVote.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ripple/app/misc/FeeVote.h b/src/ripple/app/misc/FeeVote.h index 543f4cdb634..d8948a150b3 100644 --- a/src/ripple/app/misc/FeeVote.h +++ b/src/ripple/app/misc/FeeVote.h @@ -46,10 +46,10 @@ class FeeVote static constexpr FeeUnit32 reference_fee_units{10}; /** The account reserve requirement in drops. */ - XRPAmount account_reserve{20 * DROPS_PER_XRP}; + XRPAmount account_reserve{10 * DROPS_PER_XRP}; /** The per-owned item reserve requirement in drops. */ - XRPAmount owner_reserve{5 * DROPS_PER_XRP}; + XRPAmount owner_reserve{2 * DROPS_PER_XRP}; }; virtual ~FeeVote() = default; From f7fc5aaef34c5134a776372aeac84b46a9513353 Mon Sep 17 00:00:00 2001 From: Richard Holland Date: Wed, 26 Oct 2022 09:41:24 +0000 Subject: [PATCH 2/2] fix unit tests for 10/2 reserve --- src/test/app/AccountDelete_test.cpp | 8 ++++---- src/test/app/FeeVote_test.cpp | 12 ++++++------ src/test/rpc/AccountTx_test.cpp | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/test/app/AccountDelete_test.cpp b/src/test/app/AccountDelete_test.cpp index db2ac5799d0..73a0ccbf9e0 100644 --- a/src/test/app/AccountDelete_test.cpp +++ b/src/test/app/AccountDelete_test.cpp @@ -515,16 +515,16 @@ class AccountDelete_test : public beast::unit_test::suite // All it takes is a large enough XRP payment to resurrect // becky's account. Try too small a payment. - env(pay(alice, becky, XRP(19)), ter(tecNO_DST_INSUF_XRP)); + env(pay(alice, becky, XRP(9)), ter(tecNO_DST_INSUF_XRP)); env.close(); // Actually resurrect becky's account. - env(pay(alice, becky, XRP(20))); + env(pay(alice, becky, XRP(10))); env.close(); // becky's account root should be back. BEAST_EXPECT(env.closed()->exists(beckyAcctKey)); - BEAST_EXPECT(env.balance(becky) == XRP(20)); + BEAST_EXPECT(env.balance(becky) == XRP(10)); // becky's resurrected account can be the destination of alice's // PayChannel. @@ -541,7 +541,7 @@ class AccountDelete_test : public beast::unit_test::suite env(payChanClaim()); env.close(); - BEAST_EXPECT(env.balance(becky) == XRP(20) + payChanXRP); + BEAST_EXPECT(env.balance(becky) == XRP(10) + payChanXRP); } void diff --git a/src/test/app/FeeVote_test.cpp b/src/test/app/FeeVote_test.cpp index a2dd76fa47c..4c2acf6297d 100644 --- a/src/test/app/FeeVote_test.cpp +++ b/src/test/app/FeeVote_test.cpp @@ -34,8 +34,8 @@ class FeeVote_test : public beast::unit_test::suite Section config; auto setup = setup_FeeVote(config); BEAST_EXPECT(setup.reference_fee == 10); - BEAST_EXPECT(setup.account_reserve == 20 * DROPS_PER_XRP); - BEAST_EXPECT(setup.owner_reserve == 5 * DROPS_PER_XRP); + BEAST_EXPECT(setup.account_reserve == 10 * DROPS_PER_XRP); + BEAST_EXPECT(setup.owner_reserve == 2 * DROPS_PER_XRP); } { Section config; @@ -57,8 +57,8 @@ class FeeVote_test : public beast::unit_test::suite // Illegal values are ignored, and the defaults left unchanged auto setup = setup_FeeVote(config); BEAST_EXPECT(setup.reference_fee == 10); - BEAST_EXPECT(setup.account_reserve == 20 * DROPS_PER_XRP); - BEAST_EXPECT(setup.owner_reserve == 5 * DROPS_PER_XRP); + BEAST_EXPECT(setup.account_reserve == 10 * DROPS_PER_XRP); + BEAST_EXPECT(setup.owner_reserve == 2 * DROPS_PER_XRP); } { Section config; @@ -87,8 +87,8 @@ class FeeVote_test : public beast::unit_test::suite // Illegal values are ignored, and the defaults left unchanged auto setup = setup_FeeVote(config); BEAST_EXPECT(setup.reference_fee == 10); - BEAST_EXPECT(setup.account_reserve == 20 * DROPS_PER_XRP); - BEAST_EXPECT(setup.owner_reserve == 5 * DROPS_PER_XRP); + BEAST_EXPECT(setup.account_reserve == 10 * DROPS_PER_XRP); + BEAST_EXPECT(setup.owner_reserve == 2 * DROPS_PER_XRP); } } diff --git a/src/test/rpc/AccountTx_test.cpp b/src/test/rpc/AccountTx_test.cpp index f5709c28e87..1d537d47791 100644 --- a/src/test/rpc/AccountTx_test.cpp +++ b/src/test/rpc/AccountTx_test.cpp @@ -547,7 +547,7 @@ class AccountTx_test : public beast::unit_test::suite // All it takes is a large enough XRP payment to resurrect // becky's account. Try too small a payment. - env(pay(alice, becky, XRP(19)), ter(tecNO_DST_INSUF_XRP)); + env(pay(alice, becky, XRP(9)), ter(tecNO_DST_INSUF_XRP)); env.close(); // Actually resurrect becky's account.