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

Incorrect VoteInfo Reference docs v0.38 #94

Open
brennanjl opened this issue Sep 24, 2024 · 0 comments
Open

Incorrect VoteInfo Reference docs v0.38 #94

brennanjl opened this issue Sep 24, 2024 · 0 comments

Comments

@brennanjl
Copy link

brennanjl commented Sep 24, 2024

I spotted some outdated documentation in the VoteInfo reference docs for CometBFT v0.38. The docs document having a last_signed_block field, which is a boolean. This is accurate for CometBFT v0.37, which has the following VoteInfo struct:

type VoteInfo struct {
	Validator       Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator"`
	SignedLastBlock bool      `protobuf:"varint,2,opt,name=signed_last_block,json=signedLastBlock,proto3" json:"signed_last_block,omitempty"`
}

In CometBFT v0..38, this was changed to an enumerator:

type VoteInfo struct {
	Validator   Validator          `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator"`
	BlockIdFlag types1.BlockIDFlag `protobuf:"varint,3,opt,name=block_id_flag,json=blockIdFlag,proto3,enum=tendermint.types.BlockIDFlag" json:"block_id_flag,omitempty"`
}

// types1 package:

// BlockIdFlag indicates which BlockID the signature is for
type BlockIDFlag int32

const (
	BlockIDFlagUnknown BlockIDFlag = 0
	BlockIDFlagAbsent  BlockIDFlag = 1
	BlockIDFlagCommit  BlockIDFlag = 2
	BlockIDFlagNil     BlockIDFlag = 3
)

I believe this change was made due to vote extensions. I would create a PR fixing this, however I am unsure what each of the enumerators means (which is why I had to reference the docs in the first place). Any help from someone with more context on what each of these means would be very helpful! If there's somewhere else where I can find this info, I'm happy to make the updates myself and make a PR.

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

1 participant