From 0362e935afecbb35f5b1388466f3669a80bff545 Mon Sep 17 00:00:00 2001 From: Alloy Networks <45832257+alloynetworks@users.noreply.github.com> Date: Tue, 13 Dec 2022 20:56:35 +0200 Subject: [PATCH] Reduce default reserves to 10/2 (#4329) 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. Co-authored-by: Richard Holland --- src/ripple/app/misc/FeeVote.h | 4 ++-- src/test/app/AccountDelete_test.cpp | 8 ++++---- src/test/app/FeeVote_test.cpp | 12 ++++++------ src/test/rpc/AccountTx_test.cpp | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/ripple/app/misc/FeeVote.h b/src/ripple/app/misc/FeeVote.h index 543f4cdb6..d8948a150 100644 --- a/src/ripple/app/misc/FeeVote.h +++ b/src/ripple/app/misc/FeeVote.h @@ -46,10 +46,10 @@ public: 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; diff --git a/src/test/app/AccountDelete_test.cpp b/src/test/app/AccountDelete_test.cpp index db2ac5799..73a0ccbf9 100644 --- a/src/test/app/AccountDelete_test.cpp +++ b/src/test/app/AccountDelete_test.cpp @@ -515,16 +515,16 @@ public: // 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 @@ public: 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 a2dd76fa4..4c2acf629 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 f5709c28e..1d537d477 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.