Sponsored Content
Skip to content

chore: Update default values of base and owner reserve to 1/0.2 - #6382

Merged
bthomee merged 9 commits into
XRPLF:developfrom
xVet:update-default-owner-base-fee
May 6, 2026
Merged

chore: Update default values of base and owner reserve to 1/0.2#6382
bthomee merged 9 commits into
XRPLF:developfrom
xVet:update-default-owner-base-fee

Conversation

@xVet

@xVet xVet commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Updated the old base reserve 10 XRP and owner reserve 2 XRP to the current network levels 1 XRP and 0.2 XRP respectively.

Context of Change

Type of Change

  • 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)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@mvadari
mvadari requested review from SFsourDoh and bthomee February 18, 2026 16:40
Comment thread src/test/jtx/impl/envconfig.cpp Outdated

@mvadari mvadari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also change the sample config

@xVet

xVet commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

Should also change the sample config

done

@bthomee

bthomee commented Mar 8, 2026

Copy link
Copy Markdown
Collaborator

@xVet would you be able to fix the test failures? A quick scan shows two issues:

Failure to build on some distros:

/__w/rippled/rippled/src/xrpld/core/Config.h:56:29: error: implicit conversion from 'double' to 'value_type' (aka 'long') changes value from 0.2 to 0 [-Werror,-Wliteral-conversion]
   56 |     XRPAmount owner_reserve{0.2 * DROPS_PER_XRP};
      |                             ^~~ ~

Failure to test on other distros:

xrpld: /__w/rippled/rippled/src/libxrpl/tx/Transactor.cpp:298: static xrpl::XRPAmount xrpl::Transactor::calculateOwnerReserveFee(const xrpl::ReadView&, const xrpl::STTx&): Assertion `("xrpl::Transactor::calculateOwnerReserveFee : Owner reserve is " "reasonable") && (view.fees().increment > view.fees().base * 100)' failed.

I'll update your branch with the latest from develop, as we've added more static code analyzers recently (with more to come), so it might be that when you take a look you'll see other results.

@github-actions

Copy link
Copy Markdown

⚠️ This PR contains unsigned commits. To get your PR merged, please sign them. ⚠️

If only the most recent commit is unsigned, you can run:

  1. Amend the commit: git commit --amend --no-edit -n -S
  2. Overwrite the commit: git push --force-with-lease

If multiple commits are unsigned, you can run:

  1. Go into interactive rebase mode: git rebase --interactive HEAD~<NUM_OF_COMMITS>, where NUM_OF_COMMITS is the number of most recent commits that will be available to edit.
  2. Change "pick" to "edit" for the commits you need to sign, and then save and exit.
  3. For each commit, run: git commit --amend --no-edit -n -S
  4. Continue the rebase: git rebase --continue
  5. Overwrite the commit(s): git push --force-with-lease

If you're new to commit signing, there are different ways to set it up:

Sign commits with gpg

Follow the steps below to set up commit signing with gpg:

  1. Generate a GPG key
  2. Add the GPG key to your GitHub account
  3. Configure git to use your GPG key for commit signing
Sign commits with ssh-agent

Follow the steps below to set up commit signing with ssh-agent:

  1. Generate an SSH key and add it to ssh-agent
  2. Add the SSH key to your GitHub account
  3. Configure git to use your SSH key for commit signing
Sign commits with 1Password

You can also sign commits using 1Password, which lets you sign commits with biometrics without the signing key leaving the local 1Password process.
See use 1Password to sign your commits.

xVet and others added 5 commits April 30, 2026 00:46
XRPAmount only defines operator*(value_type), so 0.2 * DROPS_PER_XRP
truncates 0.2 to 0 (long), leaving owner_reserve = 0 drops. On strict
builds this is caught at compile time (-Werror=literal-conversion); on
lenient builds it slips through and trips the assertion in
calculateOwnerReserveFee that increment > base * 100.

Initialize owner_reserve directly with 200_000 drops (= 0.2 XRP).
@xVet
xVet force-pushed the update-default-owner-base-fee branch from c267be8 to 1502514 Compare April 29, 2026 22:46
Comment thread src/xrpld/core/Config.h Outdated

/** The account reserve requirement in drops. */
XRPAmount account_reserve{10 * DROPS_PER_XRP};
XRPAmount account_reserve{1 * DROPS_PER_XRP};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mvadari would it be more elegant to change this to XRPAmount account_reserve{1'000'000}; // 1 XRP?

We can also wait until the value changes in the future again in a small amount up or down, but it'd be easier to change then and aesthetically it'd be consistent with the owner reserve below.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree

@bthomee bthomee changed the title update default values of base and owner reserve to 1/0.2 chore: Update default values of base and owner reserve to 1/0.2 Apr 30, 2026
@bthomee

bthomee commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

@xVet it looks like the adjustment results in a test failure:

17> #52 failed: apply (/__w/rippled/rippled/src/test/rpc/AccountTx_test.cpp:777): Got temBAD_AMOUNT (Malformed: Bad amount.); Expected tecNO_DST_INSUF_XRP (Destination does not exist. Too little XRP sent to create it.)

The relevant code is here:

// All it takes is a large enough XRP payment to resurrect
// becky's account.  Try too small a payment.
env(pay(alice, becky, drops(env.current()->fees().accountReserve(0)) - XRP(1)), ter(tecNO_DST_INSUF_XRP));

Since the account reserve went from 10 XRP to 1 XRP, I suppose it tried to send 0 drops, hence the error. It might be worthwhile changing this to use the account_reserve variable in FeeSetup directly and subtract 1 drop from it to make it more future proof.

@xVet

xVet commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

@xVet it looks like the adjustment results in a test failure:


17> #52 failed: apply (/__w/rippled/rippled/src/test/rpc/AccountTx_test.cpp:777): Got temBAD_AMOUNT (Malformed: Bad amount.); Expected tecNO_DST_INSUF_XRP (Destination does not exist. Too little XRP sent to create it.)

The relevant code is here:


// All it takes is a large enough XRP payment to resurrect

// becky's account.  Try too small a payment.

env(pay(alice, becky, drops(env.current()->fees().accountReserve(0)) - XRP(1)), ter(tecNO_DST_INSUF_XRP));

Since the account reserve went from 10 XRP to 1 XRP, I suppose it tried to send 0 drops, hence the error. It might be worthwhile changing this to use the account_reserve variable in FeeSetup directly and subtract 1 drop from it to make it more future proof.

Ahh yes, i see, thank you!

The test paid (accountReserve - XRP(1)) to verify a too-small payment
is rejected with tecNO_DST_INSUF_XRP. With the new 1 XRP account
reserve, that becomes 0 drops and is rejected earlier with
temBAD_AMOUNT.

Subtract 1 drop instead of 1 XRP so the payment lands just below the
reserve regardless of its absolute value.
@codecov

codecov Bot commented May 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.1%. Comparing base (5e1c35f) to head (67441e6).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #6382   +/-   ##
=======================================
  Coverage     82.1%   82.1%           
=======================================
  Files         1010    1010           
  Lines        76024   76024           
  Branches      7383    7369   -14     
=======================================
+ Hits         62401   62402    +1     
+ Misses       13623   13622    -1     
Files with missing lines Coverage Δ
src/xrpld/core/Config.h 87.5% <ø> (ø)

... and 10 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

@godexsoft

Copy link
Copy Markdown
Contributor

We recently merged a refactor to develop that enables clang-tidy's readability-identifier-naming. Your branch now has heavy conflicts that are largely mechanical. Below is a workflow that aligns your branch's naming with develop before merging, which should minimize the merge conflicts.

One-time setup

If you don't already have clang-tidy working in your env, on macOS:

brew install llvm@21
# Follow brew's hint to put $(brew --prefix llvm@21)/bin on PATH so run-clang-tidy is found.

Workflow on your branch (before merging develop)

1. Grab the new .clang-tidy from develop without pulling anything else. Sync your fork on GitHub first, then:

git remote -v   # should show 'upstream' among others; if not:
# git remote set-url upstream git@github.com:XRPLF/rippled.git
git fetch upstream
git checkout upstream/develop -- .clang-tidy

2. Reconfigure conan/cmake so compile_commands.json is fresh.

3. Apply renames for the files modified in your PR:

git diff --name-only $(git merge-base HEAD upstream/develop) HEAD \
  | grep -E '\.(cpp|h|hpp|ipp)$' \
  | xargs run-clang-tidy -p build -fix -allow-no-checks
# or -p .build, or whatever your build dir is called

4. Build + test, then commit as a single dedicated commit:

cmake --build build -j8
git commit -am "refactor: Align identifier naming with develop"

5. Now merge develop:

git merge upstream/develop

Extra

Run clang-tidy once more after the merge to catch any stragglers introduced from develop's side:

run-clang-tidy -p build -fix -allow-no-checks src tests
# or -p .build, or whatever your build dir is called

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown

All conflicts have been resolved. Assigned reviewers can now start or resume their review.

Comment thread src/xrpld/core/Config.h Outdated
@bthomee

bthomee commented May 5, 2026

Copy link
Copy Markdown
Collaborator

@xVet ready to merge?

(I see some builds are flaky - I'll retry them once all pipelines complete.)

@xVet

xVet commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@xVet ready to merge?

(I see some builds are flaky - I'll retry them once all pipelines complete.)

Ready!

@bthomee
bthomee enabled auto-merge May 6, 2026 10:38
@bthomee
bthomee added this pull request to the merge queue May 6, 2026
Merged via the queue into XRPLF:develop with commit 50244a8 May 6, 2026
3 checks passed
@mvadari mvadari added this to the 3.2.0 milestone May 20, 2026
beartec-jpg pushed a commit to beartec-jpg/FalconLedger that referenced this pull request Jun 1, 2026
…F#6382)

Co-authored-by: Bart <bthomee@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants