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

Rosetta /network/status genesis_block_identifier and empty oldest_block_identifier #13827

Closed
Tracked by #14007
JulianToledano opened this issue Nov 10, 2022 · 0 comments · Fixed by #13832
Closed
Tracked by #14007
Labels
C:Rosetta Issues and PR related to Rosetta

Comments

@JulianToledano
Copy link
Contributor

Summary of Bug

Currently rosetta server response to /network/status sets genesis_block_identifier to InitialHeight by downloading the genesis blob. This is not correct as InitialHeight is not the genesis block of the chain but the block with height 1.

Furthermore as the rosetta documentation explains: oldest_block_identifier identifies the oldest block available to query, if this field is not populated then it is assumed that the genesis_block_identifier is the oldest queryable block.

Currently oldest_block_identifier is not being populated and it should be as the oldest queryable block may not be neither block with height 1 nor InitialHeight, but EarliestBlockHeight from tendermint syncstatus RPC response.

Version

61effe8

Steps to Reproduce

Start rosetta server:
./build/simd rosetta --blockchain Cosmos --network cosmoshub-4 --grpc $GRPC:9090 --tendermint $TENDERMINT:26657 --log_level debug

and make a call to /network/status:

curl $ROSETTA:8080/network/status -d '{"network_identifier":{"blockchain":"Cosmos", "network":"cosmoshub-4"}}' | jq

Proposal

When calling /network/status

  • oldest_block_identifier should be populated with EarliestBlockHeight
  • genesis_block_identifier should be either:
    • populated with height 1, if the block its not queryable leave it empty or with the same values as oldest_block_identifier
    • populated with InitialHeight, if the block its not queryable leave it empty or with the same values as oldest_block_identifier
@julienrbrt julienrbrt linked a pull request Nov 11, 2022 that will close this issue
19 tasks
@mergify mergify bot closed this as completed in #13832 Nov 12, 2022
mergify bot pushed a commit that referenced this issue Nov 12, 2022
## Description

Closes:
#13830
#13827

- Rosetta `/network/status` response:
   * populates `oldest_block_identifier` with `EarliestBlockHeight` from rpc syncInfo
   * tries to populate `genesis_block_identifier` with block of height 1 
     * if block is not queryable, sets value of  `InitialHeight` from genesis doc
       * if not queryable sets same value as `oldest_block_identifier`
- Wrap `github.com/tendermint/tendermint/rpc/jsonrpc/types` errors to rosetta errors
- Split services into its own go files (account, block, mempool, network)


---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [x] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [x] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [x] added a changelog entry to `CHANGELOG.md`
- [x] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
@ainhoa-a ainhoa-a added the C:Rosetta Issues and PR related to Rosetta label Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Rosetta Issues and PR related to Rosetta
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants