Finschia / ostracon

Ostracon, a consensus algorithm, is forked from Tendermint Core. We have added VRF to Tendermint BFT. It adds randomness to PoS Validator elections and improves security.
Apache License 2.0
70 stars 28 forks source link

Remove the voter election process #543

Closed ulbqb closed 1 year ago

ulbqb commented 1 year ago

Abstract

This PR remove the voter election process from Ostracon.

Background

Ostracon need some compatibility with Tendermint for IBC and cosmos-sdk. It it necessary to change possible parts for compatibility. Currently the voter election process is executed in Ostracon. Since voter selection can be moved to the lbm-sdk layer, it want to be moved to the lbm-sdk layer without putting it in Ostracon.

Goal

The goal is to fix to be compatible with Tendermint about voter election process. This means that the voter election process is removed from ostracon and it is done by only abci app. This goal need the following changes.

Policy

The changes is based on Tendermint v0.34.19. This PR contains fixes other than documentation fixes. Fixing the documents is in #544.

Results

The voter election process was removed from ostracon. However, voter selection can still be implemented with the abci app. This PR makes it impossible to change the validator for each round. Updating validators is perform in EndBlock. See tendermint docs for details.

codecov[bot] commented 1 year ago

Codecov Report

Merging #543 (6d004af) into main (6010b48) will decrease coverage by 0.08%. The diff coverage is 74.80%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #543 +/- ## ========================================== - Coverage 66.15% 66.08% -0.08% ========================================== Files 279 278 -1 Lines 37593 36981 -612 ========================================== - Hits 24871 24440 -431 + Misses 10947 10787 -160 + Partials 1775 1754 -21 ``` | [Impacted Files](https://codecov.io/gh/line/ostracon/pull/543?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line) | Coverage Δ | | |---|---|---| | [blockchain/v2/processor\_context.go](https://codecov.io/gh/line/ostracon/pull/543?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-YmxvY2tjaGFpbi92Mi9wcm9jZXNzb3JfY29udGV4dC5nbw==) | `67.44% <0.00%> (ø)` | | | [cmd/ostracon/commands/init.go](https://codecov.io/gh/line/ostracon/pull/543?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-Y21kL29zdHJhY29uL2NvbW1hbmRzL2luaXQuZ28=) | `84.21% <ø> (-0.28%)` | :arrow_down: | | [config/toml.go](https://codecov.io/gh/line/ostracon/pull/543?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-Y29uZmlnL3RvbWwuZ28=) | `74.19% <ø> (ø)` | | | [consensus/replay\_file.go](https://codecov.io/gh/line/ostracon/pull/543?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-Y29uc2Vuc3VzL3JlcGxheV9maWxlLmdv) | `0.00% <0.00%> (ø)` | | | [consensus/types/round\_state.go](https://codecov.io/gh/line/ostracon/pull/543?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-Y29uc2Vuc3VzL3R5cGVzL3JvdW5kX3N0YXRlLmdv) | `0.00% <0.00%> (ø)` | | | [light/errors.go](https://codecov.io/gh/line/ostracon/pull/543?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-bGlnaHQvZXJyb3JzLmdv) | `75.00% <ø> (ø)` | | | [rpc/client/mock/client.go](https://codecov.io/gh/line/ostracon/pull/543?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-cnBjL2NsaWVudC9tb2NrL2NsaWVudC5nbw==) | `19.29% <ø> (+0.65%)` | :arrow_up: | | [rpc/core/consensus.go](https://codecov.io/gh/line/ostracon/pull/543?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-cnBjL2NvcmUvY29uc2Vuc3VzLmdv) | `32.35% <ø> (-27.03%)` | :arrow_down: | | [rpc/core/routes.go](https://codecov.io/gh/line/ostracon/pull/543?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-cnBjL2NvcmUvcm91dGVzLmdv) | `0.00% <ø> (ø)` | | | [rpc/core/types/responses.go](https://codecov.io/gh/line/ostracon/pull/543?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-cnBjL2NvcmUvdHlwZXMvcmVzcG9uc2VzLmdv) | `35.71% <ø> (ø)` | | | ... and [48 more](https://codecov.io/gh/line/ostracon/pull/543?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line) | |
torao commented 1 year ago

I can then accept this PR if the details of the backgrounds and objectives of this modification are written.

ulbqb commented 1 year ago

@torao I updated PR description. Please comment if anything is missing.

torao commented 1 year ago

@ulbqb Does LINE Blockchain no longer support Voter elections? If so, how about the reward payout would? Or if not, how to implement voter election? This should be important information for product design.

zemyblue commented 1 year ago

@ulbqb Does LINE Blockchain no longer support Voter elections? If so, how about the reward payout would? Or if not, how to implement voter election? This should be important information for product design.

@torao , we need to move this voter selection function to lbm-sdk layer later.

ulbqb commented 1 year ago

@ulbqb Does LINE Blockchain no longer support Voter elections? If so, how about the reward payout would? Or if not, how to implement voter election? This should be important information for product design.

@torao Voter selection and reward logic can be freely implemented with abci app(lbm-sdk). Updating validators is perform in EndBlock. See tendermint docs for details.

torao commented 1 year ago

@zemyblue @ulbqb All right. We have an implicit agreement in our private discussion about how to conduct voter elections, but this PR only contains bits and pieces of information, which is why I asked the question.

To state our conclusion for those interested in LINE Blockchain, we plan to move the behaviour known as voter election from ostracon to the lbm-sdk. This is because in Tendermint, the selection of Validators is the responsibility of the Cosmos-SDK and we have chosen to follow that approach. In this PR, we'll remove the voter election from Ostracon and implement it in a future update to the lbm-sdk.

egonspace commented 1 year ago

Hi guys~ Wow, this is amazing! If so, do you give up functions such as selecting proposer according to probability? I don't think the sdk layer can be involved in selecting the proposer.

ulbqb commented 1 year ago

@egonspace Hello.

If so, do you give up functions such as selecting proposer according to probability?

No. This PR removed only the voter election from ostracon. The proposer election is still run by ostracon.