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

Registry query for nodes by consensus address #2961

Closed
wjdfx opened this issue Jun 1, 2020 · 2 comments · Fixed by #3067
Closed

Registry query for nodes by consensus address #2961

wjdfx opened this issue Jun 1, 2020 · 2 comments · Fixed by #3067
Assignees
Labels
c:registry Category: entity/node/runtime registry service

Comments

@wjdfx
Copy link

wjdfx commented Jun 1, 2020

In use of gRPC. In order to better process block data, methodGetBlock should include some info related to the proposer entity address or proposer nodes address.

Now I use this method
methodGetBlock = serviceName.NewMethod("GetBlock", int64(0))
got the result :

{
 "version": {
    "block": 10,
    "app": 1638400
 },
 "chain_id": "41e79e2847b9188e6bf0246dc86a01a01cf11bbed6ca666b45",
 "height": 274755,
 "time": 1590845914,
 "last_block_id": {
    "hash": "Oylj7JUe36vHGbwvY9HFI0U1iZQj1VyNg/S7dnMkyQA=",
    "parts": {
       "hash": "yFZus9sNLqBq+14438QRZx1WuiKJc7Ug8pYphX0SGP4=",
       "total": 1
    }
 },
 "last_commit_hash": "0+MePs++luveOL9QG8j9ZLCR710YZ7GmFZ6QGvsJBf4=",
 "data_hash": null,
 "validators_hash": "U1+J1ANtw0wM61+xdMltO4ghx3w14H9JHGxZ9OSiFPg=",
 "next_validators_hash": "U1+J1ANtw0wM61+xdMltO4ghx3w14H9JHGxZ9OSiFPg=",
 "consensus_hash": "BICRvH3cKD93v7+R1zxE2ljD34qcvIZ0Bdi389qtoi8=",
 "app_hash": "VHEOn10lDB6HZ7rXOv8WAU3QzS0t7Hr6dZljhc5hHJU=",
 "last_results_hash": null,
 "evidence_hash": null,
 "proposer_address": "hOwR6glpRGOpwtaO4x6CAfgDyAg="
}

From the rusult, we can see block proposer only has node's consensus public key: is "hOwR6glpRGOpwtaO4x6CAfgDyAg=", No entity address information, no node address information. There is no way to related them.

@kostko
Copy link
Member

kostko commented Jun 1, 2020

The proposer address corresponds to (in case of the Tendermint consensus backend) a Tendermint address computed from the node's consensus key. This information is available in .Consensus.ID in the node descriptor.

So all the information is already there you only need an index from consensus addresses to node IDs. Such an index exists internally, but is currently not exposed and it may be a good idea to expose a way to query this information (until then you could build the index yourself).

@kostko kostko added the c:registry Category: entity/node/runtime registry service label Jun 1, 2020
@kostko kostko changed the title methodGetBlock need include proposer entity address or nodes address. Registry query for nodes by consensus address Jun 1, 2020
@SmartStake
Copy link

it would be very good to have a way to know which entity proposed each block. appreciate having an api that allows me to query all blocks and determine the entity. will help flag issues with given entities

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:registry Category: entity/node/runtime registry service
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants