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

[get_aggregate_price] with malformed base_asset value returns different error on Clio compared to rippled #1372

Open
mounikakun opened this issue Apr 23, 2024 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@mounikakun
Copy link
Collaborator

Issue Description

Clio returns invalidParams whereas rippled returns objectNotFound with malformed base_asset values in get_aggregate_price

Steps to Reproduce

  • Create two oracles.
  • Send a get_aggregate_price request with malformed trim value.
  • Malformed base_asset values: 123, -1, 0, 1.2

Request:

{
  "method": "get_aggregate_price",
  "params": [
    {
      "base_asset": 123,
      "quote_asset": "ETH",
      "oracles": [
        {
          "account": "rwz8i5bUKa12tYxQjsSuzDQaBwKkuGUqa5",
          "oracle_document_id": 1
        },
        {
          "account": "rDtBhKmzKveCSd5jmrcQD6CU8kidCLCy7h",
          "oracle_document_id": 1
        }
      ]
    }
  ]
}

Expected Result

Rippled response:

{
    "result": {
        "error": "objectNotFound",
        "error_code": 92,
        "error_message": "The requested object was not found.",
        "ledger_current_index": 82290,
        "request": {
            "base_asset": 123,
            "command": "get_aggregate_price",
            "oracles": [
                {
                    "account": "rwz8i5bUKa12tYxQjsSuzDQaBwKkuGUqa5",
                    "oracle_document_id": 1
                },
                {
                    "account": "rDtBhKmzKveCSd5jmrcQD6CU8kidCLCy7h",
                    "oracle_document_id": 1
                }
            ],
            "quote_asset": "ETH"
        },
        "status": "error",
        "validated": false
    }
}

Actual Result

Clio response:

{
    "result": {
        "error": "invalidParams",
        "error_code": 31,
        "error_message": "Invalid parameters.",
        "status": "error",
        "type": "response",
        "request": {
            "method": "get_aggregate_price",
            "params": [
                {
                    "base_asset": 123,
                    "quote_asset": "ETH",
                    "oracles": [
                        {
                            "account": "rwz8i5bUKa12tYxQjsSuzDQaBwKkuGUqa5",
                            "oracle_document_id": 1
                        },
                        {
                            "account": "rDtBhKmzKveCSd5jmrcQD6CU8kidCLCy7h",
                            "oracle_document_id": 1
                        }
                    ]
                }
            ]
        }
    },
    "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"
        }
    ]
}

Environment

Supporting Files

@mounikakun mounikakun added the bug Something isn't working label Apr 23, 2024
@cindyyan317
Copy link
Collaborator

I think Clio's response (invalidParams) maybe more descriptive.

@mounikakun mounikakun added this to Current Queue in Bug Bash Road to 100% (v2.2.0) May 2, 2024
@mounikakun
Copy link
Collaborator Author

Issue is fixed on rippled end for the below invalid test data.

None, "Invalid", 123, -1, 0, 1.2,  "H", "HB", "HBAR", "", _INVALID_NON_STANDARD_CURRENCY_CODE_:"0158415500000000C1F76FF6ECB0BAC600000000A"

objectNotFound remains same for the below cases

VALID_NON_STANDARD_CURRENCY_CODE = "0158415500000000C1F76FF6ECB0BAC600000000", "HBA"

@mounikakun
Copy link
Collaborator Author

Clio is not replicating invalidParams error for below test data

"Invalid", _INVALID_NON_STANDARD_CURRENCY_CODE_:"0158415500000000C1F76FF6ECB0BAC600000000A", "H", "HB", "HBAR", ""

@cindyyan317 cindyyan317 added the good first issue Good for newcomers label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants