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

Convert Tendermint Block Response #3544

Closed
4 tasks
jbibla opened this issue Feb 7, 2019 · 22 comments · Fixed by #11390
Closed
4 tasks

Convert Tendermint Block Response #3544

jbibla opened this issue Feb 7, 2019 · 22 comments · Fixed by #11390

Comments

@jbibla
Copy link
Contributor

jbibla commented Feb 7, 2019

Summary of Bug

these endpoints should return the proposer_address in bech32 format according to the swagger docs. this would be ideal for client developers.

block/{height}
block/latest
{
  "block_meta": {
      "proposer_address": "cosmos1depk54cuajgkzea6zpgkq36tnjwdzv4afc3d27"

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alexanderbez
Copy link
Contributor

Thanks @jbibla!

@alexanderbez
Copy link
Contributor

The latest develop, 7f74b33e, returns the proper addresses as raw hex, not bech32 encoded. So nothing to change afaik?

@jbibla
Copy link
Contributor Author

jbibla commented Feb 9, 2019

@alexanderbez sorry for the confusion: can it please return the proposer_address as a bech32 encoded address?

@alexanderbez
Copy link
Contributor

Sure I think we can accommodate that. But won't be it be somewhat weird? It'll be the only value not in raw HEX.

@jbibla
Copy link
Contributor Author

jbibla commented Feb 11, 2019

@cosmos/cosmos-ui how do you feel about this idea?

@faboweb
Copy link
Contributor

faboweb commented Feb 11, 2019

I thought we agreed that every consumer/client facing address is in bech32 format?

@faboweb faboweb reopened this Feb 11, 2019
@alexanderbez
Copy link
Contributor

Actually this seems to be a Tendermint response. I'm not sure we can modify this w/o converting the response to a new structure.

@faboweb
Copy link
Contributor

faboweb commented Feb 11, 2019

Let's convert it to a new structure. The REST API should provide a better experience then just forwarding Tendermint messages imo.

@jbibla
Copy link
Contributor Author

jbibla commented Feb 11, 2019

i agree with @faboweb here - we could use the RPC for raw HEXs but we'd prefer to use the REST API.

@alexanderbez
Copy link
Contributor

Being that that this is an TM RPC call, what actionable items are you asking for here?

@faboweb
Copy link
Contributor

faboweb commented Feb 12, 2019

We should process the TM RPC call in the REST server endpoint, convert the response into a new struct which fulfills the requirements of the REST server (convert HEX addresses to bech32).

There will also be more conversions for the block response necessary. I.e. the transactions in the block object need to be converted to either links to the actual transactions or resolved into the actual transaction objects. Currently transactions are in base64 format as far as I remember.

@fedekunze
Copy link
Collaborator

does this issue still apply?

@jbibla
Copy link
Contributor Author

jbibla commented Jul 2, 2019

@faboweb

@faboweb
Copy link
Contributor

faboweb commented Jul 2, 2019

I think this still applies

@alexanderbez
Copy link
Contributor

Yes, we're still returning the raw response from Tendermint. We'll have to intercept this response and convert it to a new type that converts all the addresses (not just the proposer). Also note, the validator address is cosmosvalcons...

@alexanderbez alexanderbez changed the title blocks endpoints return proposer_address as hash instead of bech32 Convert Tendermint Block Response Jul 3, 2019
@RiccardoM
Copy link
Contributor

Guys if you want I can start working on this issue as I think it might be useful. Could you please point me in the right direction to do so? How should I intercept the response?

@alexanderbez @faboweb

@alexanderbez
Copy link
Contributor

Yes @RiccardoM. Take a look at client/rpc/block.go. In there we call a private function getBlock. You'll have to parse and modify the response.

@tnachen
Copy link
Contributor

tnachen commented Aug 19, 2019

@RiccardoM are you still planning to work on this?

@RiccardoM
Copy link
Contributor

@tnachen Yup, I've started working on it but I stopped due to other priorities. I will start working on it again in the next days

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jul 17, 2020
@tac0turtle tac0turtle removed the stale label Jun 1, 2021
@tac0turtle
Copy link
Member

we have an endpoint to convert txs into sdk txs for a block, we should be able to add proposer here as well

@tac0turtle tac0turtle moved this from Backlog to Ready in Cosmos SDK Maintenance Mar 11, 2022
@amaury1093
Copy link
Contributor

@atheeshp will be looking into this

@amaury1093 amaury1093 moved this from Ready to In Progress in Cosmos SDK Maintenance Mar 15, 2022
@amaury1093 amaury1093 moved this from In Progress to In Review in Cosmos SDK Maintenance Mar 17, 2022
@amaury1093 amaury1093 moved this from In Review to Ready in Cosmos SDK Maintenance Mar 30, 2022
@tac0turtle tac0turtle removed the REST label May 9, 2022
@tac0turtle tac0turtle moved this to 📝 Todo in Cosmos-SDK May 9, 2022
@tac0turtle tac0turtle moved this from 📝 Todo to 💪 In Progress in Cosmos-SDK May 9, 2022
@mergify mergify bot closed this as completed in #11390 Jul 13, 2022
mergify bot pushed a commit that referenced this issue Jul 13, 2022
## Description

Closes: #3544



---

### 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...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] 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)
Repository owner moved this from 💪 In Progress to 👏 Done in Cosmos-SDK Jul 13, 2022
mergify bot pushed a commit that referenced this issue Jul 13, 2022
## Description

Closes: #3544

---

### 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...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] 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)

(cherry picked from commit e89db04)

# Conflicts:
#	api/cosmos/base/tendermint/v1beta1/query.pulsar.go
#	client/grpc/tmservice/query.pb.go
tac0turtle pushed a commit that referenced this issue Jul 13, 2022
* refactor: change tmblock to sdkblock (#11390)

## Description

Closes: #3544

---

### 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...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] 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)

(cherry picked from commit e89db04)

# Conflicts:
#	api/cosmos/base/tendermint/v1beta1/query.pulsar.go
#	client/grpc/tmservice/query.pb.go

* resolve conflicts

* remove api/

Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
Co-authored-by: atheesh <atheesh@vitwit.com>
JeancarloBarrios pushed a commit to agoric-labs/cosmos-sdk that referenced this issue Sep 28, 2024
…12549)

* refactor: change tmblock to sdkblock (cosmos#11390)

## Description

Closes: cosmos#3544

---

### 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...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] 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)

(cherry picked from commit e89db04)

# Conflicts:
#	api/cosmos/base/tendermint/v1beta1/query.pulsar.go
#	client/grpc/tmservice/query.pb.go

* resolve conflicts

* remove api/

Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
Co-authored-by: atheesh <atheesh@vitwit.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

9 participants