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

/accounts/balance hangs #347

Closed
pro-wh opened this issue May 24, 2022 · 10 comments
Closed

/accounts/balance hangs #347

pro-wh opened this issue May 24, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@pro-wh
Copy link
Collaborator

pro-wh commented May 24, 2022

probably happens when we try to populate the detailed delegation records for our custom metadata.

we'll have to remove this because we don't currently have a way to retrieve this other than to brute-force loop over all delegations

cross reference #61 , #62

@pro-wh
Copy link
Collaborator Author

pro-wh commented Aug 25, 2022

From #377:

When attempting to use the balance endpoint to get the escrow balance the server hangs:

curl --location --request POST '<ROSETTA_URL>/account/balance' \
--header 'Content-Type: application/json' \
--data-raw '{
    "network_identifier": {"blockchain":"Oasis","network":"b11b369e0da5bb230b220127f5e7b242d385ef8c6f54906243f30af63c815535"},
    "account_identifier": {
        "address":  "oasis1qr0j8kqnejng4rutkw7elsuweu77l06pjugaxuqx",
        "sub_account": {
            "address": "escrow"
        }
    }
}
'

Server hangs indefinitely on this request and any request with the escrow sub_account.

And thanks for posting a simple command to test with.

@protango Could I have you try on this branch? https://github.com/oasisprotocol/oasis-rosetta-gateway/tree/pro-wh/feature/delegations

@yerycs
Copy link

yerycs commented Apr 12, 2023

What is the alternative way to get escrow balance since it is still open issue and not resolved yet?
And how can I get delegations? @pro-wh

@pro-wh
Copy link
Collaborator Author

pro-wh commented Apr 12, 2023

I'd say patch out these lines

https://github.com/oasisprotocol/oasis-rosetta-gateway/blob/v2.3.0/services/account.go#L151-L170

they take a long time to run, and they could time out if the node is too slow to answer in time. this should allow you to get the escrow balance if you don't need to get the detailed delegation info

@heindrick17
Copy link

Hello @pro-wh I tried your comment by patching out code lines,
I got response. But I got 0 amount for all balance even active balance. What do you think?

@pro-wh
Copy link
Collaborator Author

pro-wh commented Apr 13, 2023

But I got 0 amount for all balance even active balance. What do you think?

can you open a new issue with some more information about this? the gateway uses the balance directly from the oasis-node. can you try getting the account info with the cli https://github.com/oasisprotocol/cli/ connected to that node?

@heindrick17
Copy link

When I try without sub_account, it is showing correct active balance. So, I don't think it is node issue.

{
      "block_identifier": {
        "index": 13422205,
        "hash": "edca42fa854d1e55c8d61b941860140315bcd6494e430a6aaf3159d0de14b2b0"
      },
      "balances": [
        {
          "value": "0",
          "currency": {
            "symbol": "ROSE",
            "decimals": 9
          }
        }
      ],
      "metadata": {
        "active_balance": "0",
        "active_shares": "0",
        "debonding_balance": "0",
        "debonding_shares": "0",
        "nonce": 128
      }
    }

It is balance response when adding sub_account after patching out code lines

@pro-wh
Copy link
Collaborator Author

pro-wh commented Apr 14, 2023

that means no ROSE is delegated to that address. you need to put in the address of, for example, a validator to see the total ROSE delegated to it.

@heindrick17
Copy link

Ah, Then how can I get delegator's escrow balance?

@pro-wh
Copy link
Collaborator Author

pro-wh commented Apr 14, 2023

unfortunately there's no fast way to do it in the 22.2.x oasis-node. there's only that slow piece of code that was timing out for you

@pro-wh
Copy link
Collaborator Author

pro-wh commented Nov 29, 2023

we've resolved this in oasis-core

@pro-wh pro-wh closed this as completed Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants