cardano-foundation / cardano-foundation/cardano-rosetta-java

account/balance endpoint returns incorrect historical rewards for stake1 addresses

Open
#590 2 comments 1 reaction 0 assignees View on GitHub
further analysis / discussions needed has pending release dependency Known Limitation potentially high effort rosetta-ts regression
Dominant language
Java
Stars
26
Forks
15
Avg merge
5d 3h
Merged PRs (30d)
2

Description

## Context & versions
Version: 1.3.2
Network: mainnet
Environment: Docker with docker-compose
Configuration: default

## Steps to reproduce
1. Execute the account/balance endpoint for a stake1 address with a past block number.

## Actual behavior
cardano-rosetta-java
> curl -s http://localhost:8080/account/balance -H 'Content-Type: application/json' --data-binary '{"network_identifier":{"blockchain": "cardano","network": "mainnet"},"block_identifier":{"index":"12335081"},"account_identifier": {"address":"stake1uxk8c5xl52mfcn8nppuktdvzaw6lsjwdnerfw7rszk6z3nqm5nagh","metadata": {}}}' | jq
{
"block_identifier": {
"index": 12335081,
"hash": "03c02b815911af94c6e96debbc55d5eb4aac636d57fd95e8716e06c5abd5980b"
},
"balances": [
{
"value": "0",
"currency": {
"symbol": "ADA",
"decimals": 6
}
}
]
}

cardano-rosetta
> curl -s http://localhost:8080/account/balance -H 'Content-Type: application/json' --data-binary '{"network_identifier":{"blockchain": "cardano","network": "mainnet"},"block_identifier":{"index":"12335081"},"account_identifier": {"address":"stake1uxk8c5xl52mfcn8nppuktdvzaw6lsjwdnerfw7rszk6z3nqm5nagh","metadata": {}}}' | jq
{
"block_identifier": {
"index": 12335081,
"hash": "03c02b815911af94c6e96debbc55d5eb4aac636d57fd95e8716e06c5abd5980b"
},
"balances": [
{
"value": "927048",
"currency": {
"symbol": "ADA",
"decimals": 6
}
}
]
}

## Expected behavior
The account/balance endpoint should return the historical unwithdrawn rewards as they were at the specified block.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the account/balance endpoint and reproduce the request against mainnet at block 12335081 using the supplied stake1 address. Trace how historical unwithdrawn rewards are selected for stake addresses, then compare the result with the cardano-rosetta response. Done means the endpoint returns 927048 ADA at that block, matching the expected historical balance.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend, blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.