-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Bug: sdk_block
translated proposer address is wrong
#14079
Comments
Why is there an |
in order to assist users in providing a decoded block instead of needing to decode themselves. There was an issue asking for this |
#11390 it's added here, I may have a look on this. |
Q1: How can we get the consensus pubkey object from consensus address (2b)? |
Truth be told, I never go from consensus address to consensus pubkey. Its just easier to match at the address. So id recommend deriving the address from the pubkey, and then matching on the addresses. As for your Q2, the validator object has a Sorry if thats not the answer you wanted. |
@minxylynx Thanks for the clarification here, but I think we may not able fetch all validators info from this helper since it doesn't have state access from there. |
Summary of Bug
The
GetBlockByHeightResponse.sdk_block.header.proposer_address
does not match the actual proposer addressVersion
0.46.6
Steps to Reproduce
Taking a block, like https://api.test.provenance.io/cosmos/base/tendermint/v1beta1/blocks/11673901, compare the
GetBlockByHeightResponse.sdk_block.header.proposer_address
(the translated address) to the actual address derived from theGetBlockByHeightResponse.block.header.proposer_address
(the bytes).The problem arises in that the proposer_address bytes should translate to the validator's consensus_address (ie. pbvalcons), not the operator_address (ie. pbvaloper).
Using the
proposer_address
bytes, you need to perform the following steps to find the actual proposer operator address:proposer_address bytes -> derived validator consensus address
EITHER
a) for all (any) validator records, using the consensus_pubkey object, derive the matching consensus address
b) OR using the derived validator consensus address from (1), derive the consensus pubkey objectNot easy, just ignore this optiona) match derived validator consensus address from (1) to a derived consensus address from (2a) to get the matching validator record
b) OR match the derived consensus pubkey from (2b) to a validator record containing the same pubkey objectAs 2b isnt necessary, just ignore this optionExample, using the URL from before
Note that the proposer_address as seen in the sdk_block object does not match
"proposer_address": "tpvaloper1eafmdyd05t4j3s7j4cgca78c3lzggkdux6nrq4"
The text was updated successfully, but these errors were encountered: