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

Make proposer selection implementation more functional #1555

Closed
milosevic opened this issue May 11, 2018 · 4 comments
Closed

Make proposer selection implementation more functional #1555

milosevic opened this issue May 11, 2018 · 4 comments
Labels
C:consensus Component: Consensus T:enhancement Type: Enhancement
Milestone

Comments

@milosevic
Copy link
Contributor

Proposer selection function is one of critical elements for correctness of Tendermint algorithm. Specification can be found here:
https://github.com/tendermint/tendermint/blob/master/docs/specification/new-spec/reactors/consensus/proposer-selection.md

Although according to the spec proposer selection is a pure function that depends on current validator set, height and round, current implementation is not very functional (it is done in the context of ValidatorSet data-structure (https://github.com/tendermint/tendermint/blob/master/types/validator_set.go#L50). This make it a bit hard to understand and reason about its correctness.

This is a proposal to make proposer selection more explicit and functional. Furthermore, the spec should be extended with the algorithm of the implementation currently used.

@ebuchman
Copy link
Contributor

A critical bug was just found in the proposer selection: #2718 (comment)

This stems from the confounding between data structure and algorithm.

We likely need to remove the Accum from the core Validator struct and track it separately.

We still want a GetProposer function, but it should be a method on some entity whose sole purpose is to handle proposer selection. The trouble is the ValidatorSet is doing too much - it’s CRUD for the validators, but its also doing the algorithmic proposer selection, entangling data from the algorithm with data from the CRUD functionality (ie. Accum in the Validator struct) which led to the issue, where something that was pure CRUD (abci EndBlock) caused us to lose data when it got converted to the validator set data type.

If accum was not part of the core validator set structures, but was tracked separately, the data loss during conversion from abci type would never have occurred

@ebuchman
Copy link
Contributor

Work is ongoing to improve/fix the proposer selection (eg. #3049) but a larger refactor of the code along these lines might be too disruptive at this time. So let's remove from the launch milestone and address a larger code cleanup here at some point in the future.

@ebuchman ebuchman modified the milestones: launch, v1.0 Jan 14, 2019
@ebuchman
Copy link
Contributor

@milosevic do you think we can close this based on the Anca's recent refactors? Or do you think we can still really improve this code?

@milosevic
Copy link
Contributor Author

I think we can close this.

firelizzard18 pushed a commit to AccumulateNetwork/tendermint that referenced this issue Feb 1, 2024
…t#1555)

* spec: update URLs to ABCI protobuf

With proto renaming and versioning, it should point to the latest
versioned package under the cometbft.abci.

* proto: remove outdated go_package references

In the legacy tendermint.* protos, there should not be go_package
references because we no longer use them to generate Go code.

* spec: replace mentions of `Request*`/`Response*`

Replace with `*Request`, `*Response`, or the exact name of the message
in question.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:consensus Component: Consensus T:enhancement Type: Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants