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

Allow querying for genesis transactions on height 0 #3867

Closed
4 tasks
faboweb opened this issue Mar 13, 2019 · 16 comments · Fixed by #4788
Closed
4 tasks

Allow querying for genesis transactions on height 0 #3867

faboweb opened this issue Mar 13, 2019 · 16 comments · Fixed by #4788
Assignees
Milestone

Comments

@faboweb
Copy link
Contributor

faboweb commented Mar 13, 2019

Summary

It would be nice to be able to query the genesis block as height 0.

Problem Definition

We can query blocks, validatorsets, transactions and others by block height. For the block 0 (genesis block) we can't.

Proposal

It would be nice to unify this experience by indexing the block, transactions and others as height 0 even if they miss some properties.


For Admin Use

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

Why can't you get block 1?

@faboweb
Copy link
Contributor Author

faboweb commented Mar 13, 2019

It's not the genesis block isn't it? So I wouldn't see the genesis transactions.

@fedekunze
Copy link
Collaborator

we can query the genesis txs using the /genesis rpc endpoint and parse the gen_txs property

@alexanderbez
Copy link
Contributor

Great! Can we close this issue then?

@fedekunze
Copy link
Collaborator

we could do something like /txs/genesis or /txs?tx.height=0 to get the txs, bc technically it's not a block

@faboweb
Copy link
Contributor Author

faboweb commented Mar 19, 2019

I think the biggest case is genesis transactions. So I change the title.

@faboweb faboweb changed the title Index genesis block as block 0 Allow querying for genesis transactions on height 0 Mar 19, 2019
@jackzampolin
Copy link
Member

jackzampolin commented Mar 19, 2019

@fedekunze why not make /txs?tx.height=0 parse genesis and pull out the gentx? (i.e. sugar)

@faboweb
Copy link
Contributor Author

faboweb commented Mar 20, 2019

That's what he is suggesting I think ;)

@fedekunze
Copy link
Collaborator

@colin-axner want to take on this one when you have time?

The scope would be:

  • pulling the gentxs from the genesis state and return them on a query if heigth=0

For the next iteration, we could add events for each of the genesis txs to make them queryable

@colin-axner
Copy link
Contributor

@fedekunze yea I can take this on

@colin-axner colin-axner self-assigned this Jul 17, 2019
@colin-axner
Copy link
Contributor

What is the reasoning for not just adding a new endpoint as suggested above, /txs/genesis? I think this would be a cleaner implementation then using /txs?tx.height=0

@fedekunze
Copy link
Collaborator

👍 let’s go for that one instead

@faboweb
Copy link
Contributor Author

faboweb commented Jul 18, 2019

I don't think /txs/genesis is a cleaner API. If I want to show all transactions I need to stitch again results of multiple requests together.
Also on a side note /txs/genesis conflicts with /txs/{TX_HASH}.

@colin-axner
Copy link
Contributor

@faboweb lets do the cleaner API then, I think I can make /txs?tx.height=0 work

@faboweb
Copy link
Contributor Author

faboweb commented Jul 18, 2019

Great!

@fedekunze fedekunze added this to the v0.37.0 milestone Jul 19, 2019
@colin-axner
Copy link
Contributor

Pausing work on this until #4751 is resolved and genutils is updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants