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

total_voting_power missing from RPC response #1052

Closed
ratankaliani opened this issue Jul 28, 2023 · 3 comments
Closed

total_voting_power missing from RPC response #1052

ratankaliani opened this issue Jul 28, 2023 · 3 comments

Comments

@ratankaliani
Copy link

ratankaliani commented Jul 28, 2023

Bug Report

While querying several Celestia testnet RPC's for the most recent signed_block, they fail to include total_voting_power within the ValidatorSet struct.

total_voting_power should be included in congruence with the protobuf specification for ValidatorSet which is one of the fields in ResultSignedBlock.

Setup

Queried several RPC's for signed_block

NodesGuru
Nodestake

What happened?

Missing total_voting_power from signed_block RPC response

What did you expect to happen?

total_voting_power that matches the sum of of all of the validators' voting power should be included in the RPC reponse inside of the validator_set struct.

How to reproduce it

Query Celestia testnet RPC's for the most recent signed_block and verify if total_voting_power is returned.

Anything else we need to know

The lack of this field means that Rust developers need to create a mirror struct that has an optional total_voting_power, as they can't use Set from tendermint-rs: https://github.com/informalsystems/tendermint-rs/blob/c2b5c9e01eab1c740598aa14375a7453f3bfa436/tendermint/src/validator.rs#L20-L24

If this is an intentional design decision to not return total_voting_power for signed blocks, a PR can be made to tendermint-rs to update the total_voting_power field of Set to be optional.

@rootulp
Copy link
Collaborator

rootulp commented Jul 28, 2023

Thanks for the super detailed GH issue! I don't think it's an intentional decision from Celestia to remove total_voting_power from this response. I think it's not in the RPC response b/c it's not an exported field

// cached (unexported)
totalVotingPower int64

I verified that it's still un-exported in upstream CometBFT here so I think next steps are to learn the context of the exported field in upstream CometBFT. If we can make it public upstream, then celestia-core can pull that change.

Created cometbft/cometbft#1178

@rootulp
Copy link
Collaborator

rootulp commented Aug 2, 2023

Based on cometbft/cometbft#1178 it seems unlikely that upstream will export the field anytime soon so we may want to go with the alternative option you suggested:

If this is an intentional design decision to not return total_voting_power for signed blocks, a PR can be made to tendermint-rs to update the total_voting_power field of Set to be optional.

@ratankaliani
Copy link
Author

Sounds good - thanks for opening the fix!

@ratankaliani ratankaliani closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants