livepeer / go-livepeer

Official Go implementation of the Livepeer protocol
http://livepeer.org
MIT License
538 stars 168 forks source link

Initialize round by any B/O who has the initializeRound flag set to true #3029

Closed leszko closed 4 months ago

leszko commented 4 months ago

AFAIU the current logic for the -initializeRound flag has the assumption that every O has this flag set to true. Then, it uses some calculation to decide which O sends the tx to initialize the round.

The assumption is not true and with most O having -initializeRound false we end up with the round not being initialized. This PR removes all this logic for checking who should intialize the round and just any B/O that has this flag enabled will try to initialize the round. The worst that can happen is that a lot of B/Os will try to initialize the round, but the gas price is low, so that's not too bad.

After this PR gets merged I'll set it to true in all Bs in staging for Livepeer Inc.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 12.50000% with 42 lines in your changes are missing coverage. Please review.

Project coverage is 57.32866%. Comparing base (9305333) to head (5ae9efe).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029/graphs/tree.svg?width=650&height=150&src=pr&token=vKzl2rUYvB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer)](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) ```diff @@ Coverage Diff @@ ## master #3029 +/- ## =================================================== - Coverage 57.48217% 57.32866% -0.15351% =================================================== Files 92 92 Lines 15704 15685 -19 =================================================== - Hits 9027 8992 -35 - Misses 6077 6091 +14 - Partials 600 602 +2 ``` | [Files](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) | Coverage Δ | | |---|---|---| | [cmd/livepeer/livepeer.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029?src=pr&el=tree&filepath=cmd%2Flivepeer%2Flivepeer.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer#diff-Y21kL2xpdmVwZWVyL2xpdmVwZWVyLmdv) | `50.00000% <100.00000%> (+0.33557%)` | :arrow_up: | | [eth/roundinitializer.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029?src=pr&el=tree&filepath=eth%2Froundinitializer.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer#diff-ZXRoL3JvdW5kaW5pdGlhbGl6ZXIuZ28=) | `75.40984% <35.71429%> (-17.36124%)` | :arrow_down: | | [cmd/livepeer/starter/starter.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029?src=pr&el=tree&filepath=cmd%2Flivepeer%2Fstarter%2Fstarter.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer#diff-Y21kL2xpdmVwZWVyL3N0YXJ0ZXIvc3RhcnRlci5nbw==) | `7.17897% <0.00000%> (-0.01455%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). Last update [9305333...5ae9efe](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). | [Files](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) | Coverage Δ | | |---|---|---| | [cmd/livepeer/livepeer.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029?src=pr&el=tree&filepath=cmd%2Flivepeer%2Flivepeer.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer#diff-Y21kL2xpdmVwZWVyL2xpdmVwZWVyLmdv) | `50.00000% <100.00000%> (+0.33557%)` | :arrow_up: | | [eth/roundinitializer.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029?src=pr&el=tree&filepath=eth%2Froundinitializer.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer#diff-ZXRoL3JvdW5kaW5pdGlhbGl6ZXIuZ28=) | `75.40984% <35.71429%> (-17.36124%)` | :arrow_down: | | [cmd/livepeer/starter/starter.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029?src=pr&el=tree&filepath=cmd%2Flivepeer%2Fstarter%2Fstarter.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer#diff-Y21kL2xpdmVwZWVyL3N0YXJ0ZXIvc3RhcnRlci5nbw==) | `7.17897% <0.00000%> (-0.01455%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3029/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer)