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

Currency filter + limit causes timeout

Open
#615 0 comments 0 reactions 0 assignees View on GitHub
bug? Needs Reproducing
Dominant language
Java
Stars
26
Forks
15
Avg merge
5d 3h
Merged PRs (30d)
2

Description

### Context & versions
- **Version**: rosetta-java v1.3.3
- **Network**: preprod
- **Endpoint**: `/search/transactions`

### Steps to reproduce
```bash
# This query times out (>600s)
curl -X POST http://localhost:8082/search/transactions \
-H "Content-Type: application/json" \
-d '{
"network_identifier": {"blockchain": "cardano", "network": "preprod"},
"currency": {"symbol": "tTEURO", "decimals": 2},
"limit": 1
}'

# This query works fast (~2s)
curl -X POST http://localhost:8082/search/transactions \
-H "Content-Type: application/json" \
-d '{
"network_identifier": {"blockchain": "cardano", "network": "preprod"},
"currency": {"symbol": "tTEURO", "decimals": 2}
}'
```

### Actual behavior
When combining `currency` parameter with explicit `limit` parameter, the query performs full blockchain scan and times out after 600+ seconds.

### Expected behavior
Query with `currency` filter and `limit=1` should return quickly (within 2-3 seconds), returning first matching transaction.

**Workaround**: Omit `limit` parameter when using `currency` filter - uses default limit (100) and completes in ~2s.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the `/search/transactions` endpoint and reproduce both curl requests against the preprod configuration, comparing the currency-only query with the same query using `limit=1`. Trace how the currency filter and explicit limit are combined, then verify that the limited request returns the first matching transaction within a few seconds without scanning the full blockchain.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.