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

Comply with Mesh spec on status usage in operations

Open
#505 0 comments 0 reactions 0 assignees View on GitHub
not spec compliant potentially high effort
Dominant language
Java
Stars
26
Forks
15
Avg merge
5d 3h
Merged PRs (30d)
2

Description

### Context & Versions

- **Project:** cardano-rosetta-java v1.2.9, probably other versions before
- **Network:** mainnet, preprod, or preview

---

### Steps to Reproduce

1. Start the application with the relevant parameters for your network.
2. Call the `/block`, `/block/transaction`, `/search/transactions`, and construction endpoints.
3. Inspect the `status` field in the returned operations for each endpoint.

---

### Actual Behavior

- The `status` field is inconsistently populated across endpoints:
- On-chain endpoints
- `/block`: ⌛️
- `/block/transaction`: ⌛️
- `/search/transactions`: ✅
- Construction endpoints:
- `/construction/parse`: ❌
- status is included within inputs, but must not ❌
- status is NOT included within inputs ✅
- `/construction/payloads`: ❌
- status is included within encoded transaction, but must not ❌
- `/construction/preprocess`: ⌛️
- status is included within encoded transaction, but must not ❌

---

### Expected Behavior

- **On-chain data endpoints** (`/block`, `/block/transaction`, `/construction/parse`):
Every operation *MUST have* a populated `status` field (e.g., "success" or "failed"), as all on-chain operations must have succeeded or failed.
- **Construction endpoints**:
Operations *MUST NOT have* a populated `status` field, as these represent intent and have not yet succeeded or failed.

---

### Additional Notes

- According to [Mesh documentation](https://docs.cdp.coinbase.com/mesh/docs/models#operation):
- Blockchains with atomic transactions (like Cardano, except for Phase 2 validation) should have the same status for each operation.
- On-chain operations must always have a status.
- Construction (intent) operations must never have a status.

### Checklist

- [ ] Update documentation to clarify correct usage of the `status` field for each endpoint
- [ ] Ensure on-chain endpoints (`/block`, `/block/transaction`, `/search/transactions`) always include a populated `status` field in all operations with `success`
- [ ] Ensure construction endpoints responses (`/construction/parse`) do **not** include a `status` field in any operation
- [ ] Add or update integration tests to verify correct presence/absence of the `status` field

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the handlers for /block, /block/transaction, /search/transactions, and the construction endpoints, then inspect how operation status is populated or omitted. Add or update integration tests covering status presence on on-chain responses and absence on construction responses, including /construction/parse, /construction/payloads, and /construction/preprocess. Done means the endpoint behavior matches the Mesh status rules and the tests pass.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.