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

gateway_balances introduces breaking change to API V1 due to invalidHotWallet return code (Version: 2.3.0) #1825

Closed
nkramer44 opened this issue Jan 13, 2025 · 0 comments · Fixed by #1830
Labels
bug Something isn't working compatibility
Milestone

Comments

@nkramer44
Copy link
Contributor

Issue Description

The rippled implementation of gateway_balances does not return invalidHotWallet as an error if one of the addresses provided in hotwallet does not have a trustline with account, but instead simply does not include a balance for the address in its response.

Clio, however, returns the invalidHotWallet error code when an address in hotwallet does not have a trustline with account. Although this is the correct behavior according to the xrpl.org documentation, this discrepancy between rippled and Clio should be considered a breaking change in the v1 API.

Steps to Reproduce

Call gateway_balances on rippled and provide a hot wallet that does not have a trustline to the issuer:

curl --location 'https://xrplcluster.com' \
--header 'Content-Type: application/json' \
--data '{
    "method": "gateway_balances",
    "params": [
        {
            "account": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De",
            "hotwallet": [
                "rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ"
            ],
            "ledger_index": "validated",
            "strict": true
        }
    ]
}'

This returns

{
    "result": {
        "account": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De",
        "ledger_hash": "108D37806941E711921120F53597F50403638EDACC4D64792879AF8F1DC8ECA6",
        "ledger_index": 93435385,
        "obligations": {
            "524C555344000000000000000000000000000000": "21995883.29000014"
        },
        "status": "success",
        "validated": true
    }
}

If you run the same RPC against https://s1.ripple.com which is Clio, Clio returns this

{
    "result": {
        "error": "invalidHotWallet",
        "error_code": 5004,
        "error_message": "Invalid hot wallet.",
        "status": "error",
        "type": "response",
        "request": {
            "method": "gateway_balances",
            "params": [
                {
                    "account": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De",
                    "hotwallet": [
                        "rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ"
                    ],
                    "ledger_index": "validated",
                    "strict": true
                }
            ]
        }
    },
    "warnings": [
        {
            "id": 2001,
            "message": "This is a clio server. clio only serves validated data. If you want to talk to rippled, include 'ledger_index':'current' in your request"
        }
    ]
}

Expected Result

Clio should return a successful response to gateway_balances even if one of the hotwallet does not have a trustline with account. Hot wallets that do not have a trustline to account should not be included in the response's balances array.

Actual Result

Clio returns invalidHotWallet error code

Environment

N/A

Supporting Files

@nkramer44 nkramer44 added the bug Something isn't working label Jan 13, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Clio Jan 13, 2025
@godexsoft godexsoft added this to the Future milestone Jan 13, 2025
@kennyzlei kennyzlei modified the milestones: Future, 2.4 Jan 17, 2025
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Merged in Clio Jan 21, 2025
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Merged in Clio Jan 21, 2025
kuznetsss added a commit to kuznetsss/clio that referenced this issue Feb 3, 2025
…RPLF#1830)

Fixes XRPLF#1825 by removing the check in the gateway_balances RPC handler
that returns the RpcInvalidHotWallet error code if one of the addresses
supplied in the request's `hotwallet` array does not have a trustline
with the `account` from the request.

As stated in the original ticket, this change fixes a discrepancy in
behavior between Clio and rippled, as rippled does not check for
trustline existence when handling gateway_balances RPCs

Co-authored-by: Sergey Kuznetsov <skuznetsov@ripple.com>
kuznetsss added a commit to kuznetsss/clio that referenced this issue Feb 3, 2025
…RPLF#1830)

Fixes XRPLF#1825 by removing the check in the gateway_balances RPC handler
that returns the RpcInvalidHotWallet error code if one of the addresses
supplied in the request's `hotwallet` array does not have a trustline
with the `account` from the request.

As stated in the original ticket, this change fixes a discrepancy in
behavior between Clio and rippled, as rippled does not check for
trustline existence when handling gateway_balances RPCs

Co-authored-by: Sergey Kuznetsov <skuznetsov@ripple.com>
kuznetsss added a commit to kuznetsss/clio that referenced this issue Feb 4, 2025
…RPLF#1830)

Fixes XRPLF#1825 by removing the check in the gateway_balances RPC handler
that returns the RpcInvalidHotWallet error code if one of the addresses
supplied in the request's `hotwallet` array does not have a trustline
with the `account` from the request.

As stated in the original ticket, this change fixes a discrepancy in
behavior between Clio and rippled, as rippled does not check for
trustline existence when handling gateway_balances RPCs

Co-authored-by: Sergey Kuznetsov <skuznetsov@ripple.com>
kuznetsss added a commit that referenced this issue Feb 4, 2025
#1873)

Port of #1830 into release/2.3.1.

Fixes #1825 by removing the check in the gateway_balances RPC handler
that returns the RpcInvalidHotWallet error code if one of the addresses
supplied in the request's `hotwallet` array does not have a trustline
with the `account` from the request.

As stated in the original ticket, this change fixes a discrepancy in
behavior between Clio and rippled, as rippled does not check for
trustline existence when handling gateway_balances RPCs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compatibility
Projects
Status: ✅ Merged
Development

Successfully merging a pull request may close this issue.

3 participants