livepeer / go-livepeer

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

refactor: rename internal references from Broadcaster to Gateway #3060

Closed rickstaa closed 1 month ago

rickstaa commented 2 months ago

What does this pull request do? Explain your changes. (required)

This pull request updates internal references from 'Broadcaster' to 'Gateway' in accordance with the core team’s decision. For more details, refer to the discussion: Discord Link.

It follows up on https://github.com/livepeer/go-livepeer/pull/3056 as I noticed I forgot to rename some references.

Specific updates (required)

How did you test each of these updates (required)

I checked the tests were successful and started a off-chain orchestrator and gateway.

Does this pull request close any open issues?

NO

Checklist:

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 57.40929%. Comparing base (e8f079e) to head (95418ef).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3060/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/3060?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) ```diff @@ Coverage Diff @@ ## master #3060 +/- ## ============================================= Coverage 57.40929% 57.40929% ============================================= Files 92 92 Lines 15764 15764 ============================================= Hits 9050 9050 Misses 6111 6111 Partials 603 603 ``` | [Files](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3060?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/3060?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.98039% <100.00000%> (ø)` | | | [cmd/livepeer/starter/starter.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3060?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.90514% <0.00000%> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3060?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/3060?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). Last update [e8f079e...95418ef](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3060?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/3060?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/3060?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.98039% <100.00000%> (ø)` | | | [cmd/livepeer/starter/starter.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3060?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.90514% <0.00000%> (ø)` | |
rickstaa commented 2 months ago

@victorges I noticed in https://github.com/livepeer/go-livepeer/pull/2981 hat you added the following line:

https://github.com/livepeer/go-livepeer/blob/b739f354ce42d20d51c0778156999932dd8c2ae8/cmd/livepeer/starter/starter.go#L796

Since there's no goroutine or defer statement inside the loop that could cause a closure over the loop variable, we can safely remove the p := p line I think.

victorges commented 2 months ago

Hey @rickstaa! Even tho there's no explicit go or defer statements there, there is a closure on this anonymous function sent to that auto updater: https://github.com/livepeer/go-livepeer/blob/b739f354ce42d20d51c0778156999932dd8c2ae8/cmd%2Flivepeer%2Fstarter%2Fstarter.go#L799

And that updater itself might start a goroutine that eventually runs that function.

Do you think this could be made clear in some way?

rickstaa commented 1 month ago

Hey @rickstaa! Even tho there's no explicit go or defer statements there, there is a closure on this anonymous function sent to that auto updater:

https://github.com/livepeer/go-livepeer/blob/b739f354ce42d20d51c0778156999932dd8c2ae8/cmd%2Flivepeer%2Fstarter%2Fstarter.go#L799

And that updater itself might start a goroutine that eventually runs that function.

Do you think this could be made clear in some way?

@victorges Ah, I think I had been programming for too long when I asked that question and overlooked the anonymous function 🤦🏻. Thanks for your explanation! I think in that case we are good to merge this 👍🏻.