Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delivered_amount displays amount for out of range payments (Version: 2.3.1) #5304

Open
zgrguric opened this issue Feb 20, 2025 · 1 comment

Comments

@zgrguric
Copy link

Issue Description

Sending payment of amount 0.0000000000000000001 which is out of range and will round down to zero, will yield with successful payment, but RippleState (in case of IOU in this sample) will be not modified - which is OK.

Issue is that delivered_amount will display that something is delivered.

"delivered_amount": {
    "currency": "BAR",
    "issuer": "raHYzhu84pZxKK2NjKigLmT85D3WamiorR",
    "value": "1000000000000000e-34"
}

Steps to Reproduce

Tested on XRPL Testnet with transaction:

{
    "TransactionType": "Payment",
    "Account": "r4ejfGBMqN9chqA9Xfka9kg5AKkPGvajuz",
    "Destination": "raHYzhu84pZxKK2NjKigLmT85D3WamiorR",
    "Amount": {
        "currency": "BAR",
        "value": "0.0000000000000000001",
        "issuer": "raHYzhu84pZxKK2NjKigLmT85D3WamiorR"
    },
    "NetworkID": 1
}

Expected Result

Field delivered_amount should display Amount.value: "0"

Actual Result

Field delivered_amount displays initial sent amount (which was not actually delivered)

Environment

XRPL Testnet via wss://s.altnet.rippletest.net

Testnet Transaction

https://testnet.xrplwin.com/tx/46DC72E67E0A13204A419210130F8D7323F6D4A73FAC1A91F4E2ED4CD853B985

Next steps

Test this with Native currency (XRP) payment.

@ximinez
Copy link
Collaborator

ximinez commented Feb 21, 2025

That amount (1e-34) is a valid amount on ledger, so it's not "out of range". When I looked a few minutes ago the recipient had a balance around 1e9. The STAmount representation has a precision of 15 or 16 decimal places. So, a payment of 1e-3 would be fine. This payment is so small that it basically becomes a rounding error on the account's balance.

As far as the protocol is concerned, the transaction did successfully deliver 1e-34. It just didn't meaningfully change the recipient's balance.

If I had a net worth of a trillion dollars, I wouldn't care if someone sent me a single penny.

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

No branches or pull requests

2 participants