Skip to content

feat: add proposal vote cli arg#3275

Merged
rickstaa merged 5 commits intomasterfrom
add_proposal_vote_cli_arg
Mar 9, 2025
Merged

feat: add proposal vote cli arg#3275
rickstaa merged 5 commits intomasterfrom
add_proposal_vote_cli_arg

Conversation

@rickstaa
Copy link
Copy Markdown
Member

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

This pull request gives orchestrators the ability to vote on active treasury proposal directly from the go-livepeer CLI.

Specific updates (required)

  • Adds a new CLI option people can use to vote on active proposals.
  • Adds client bindings to interact with the LivepeerGovernor contract.
  • Adds a new voteOnProposal handler on the server.
  • Adds new tests.
  • Updates outdated contracts.
    • @victorges, @leszko these other contracts were changed when I ran go generate client.go. Can you check if these really need to be updated or that my setup is incorrect.

How did you test each of these updates (required)

I wrote tests and tested the command line argument with a non-orchestrator wallet since we currently don't have a testnet. @victorges, @leszko if you reviewed this I can test with my actual wallet.

Does this pull request close any open issues?

Checklist:

@github-actions github-actions bot added the go Pull requests that update Go code label Nov 25, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 4.81622% with 751 lines in your changes missing coverage. Please review.

Project coverage is 30.41730%. Comparing base (9a27435) to head (6caa873).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
eth/contracts/livepeerToken.go 0.00000% 402 Missing ⚠️
eth/contracts/bondingManager.go 0.00000% 240 Missing ⚠️
cmd/livepeer_cli/wizard_transcoder.go 0.00000% 54 Missing ⚠️
eth/client.go 0.00000% 20 Missing ⚠️
eth/types/contracts.go 0.00000% 12 Missing ⚠️
eth/stubclient.go 0.00000% 9 Missing ⚠️
eth/contracts/controller.go 0.00000% 2 Missing ⚠️
eth/contracts/livepeerTokenFaucet.go 0.00000% 2 Missing ⚠️
eth/contracts/minter.go 0.00000% 2 Missing ⚠️
eth/contracts/poll.go 0.00000% 2 Missing ⚠️
... and 3 more
Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #3275         +/-   ##
===================================================
- Coverage   32.16679%   30.41730%   -1.74949%     
===================================================
  Files            147         148          +1     
  Lines          41033       43518       +2485     
===================================================
+ Hits           13199       13237         +38     
- Misses         27058       29505       +2447     
  Partials         776         776                 
Files with missing lines Coverage Δ
cmd/livepeer_cli/livepeer_cli.go 0.00000% <ø> (ø)
eth/contracts/LivepeerGovernor.go 0.00000% <ø> (ø)
server/handlers.go 53.53612% <100.00000%> (+1.34520%) ⬆️
server/webserver.go 95.91837% <100.00000%> (+0.04208%) ⬆️
eth/contracts/controller.go 0.00000% <0.00000%> (ø)
eth/contracts/livepeerTokenFaucet.go 0.00000% <0.00000%> (ø)
eth/contracts/minter.go 0.00000% <0.00000%> (ø)
eth/contracts/poll.go 0.00000% <0.00000%> (ø)
eth/contracts/roundsManager.go 0.00000% <0.00000%> (ø)
eth/contracts/serviceRegistry.go 0.00000% <0.00000%> (ø)
... and 7 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a27435...6caa873. Read the comment docs.

Files with missing lines Coverage Δ
cmd/livepeer_cli/livepeer_cli.go 0.00000% <ø> (ø)
eth/contracts/LivepeerGovernor.go 0.00000% <ø> (ø)
server/handlers.go 53.53612% <100.00000%> (+1.34520%) ⬆️
server/webserver.go 95.91837% <100.00000%> (+0.04208%) ⬆️
eth/contracts/controller.go 0.00000% <0.00000%> (ø)
eth/contracts/livepeerTokenFaucet.go 0.00000% <0.00000%> (ø)
eth/contracts/minter.go 0.00000% <0.00000%> (ø)
eth/contracts/poll.go 0.00000% <0.00000%> (ø)
eth/contracts/roundsManager.go 0.00000% <0.00000%> (ø)
eth/contracts/serviceRegistry.go 0.00000% <0.00000%> (ø)
... and 7 more
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rickstaa rickstaa force-pushed the add_proposal_vote_cli_arg branch from 98fa9ab to 8dc634f Compare November 25, 2024 15:20
@rickstaa rickstaa changed the title add proposal vote cli arg feat: add proposal vote cli arg Nov 25, 2024
@rickstaa rickstaa requested review from leszko, thomshutt and victorges and removed request for leszko January 2, 2025 12:48
Copy link
Copy Markdown
Contributor

@leszko leszko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added one comment. Other than that looks good.

If we don't have testnet, then my suggestion is if @rickstaa, you try it with some real proposal with your local Orchestrator and then merge.

Copy link
Copy Markdown
Contributor

@victorges victorges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!

confirm = w.readStringYesOrNo()
}

fmt.Printf("Do you want to provide a reason for your vote? (y/n) -")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be awesome to display these in the dashboard at some point!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mike will be adding it to his vote tracker. At the moment it is just me and Titan setting the reason, but with this PR we might see a lot more Orchestrators add a reason to their vote.

@leszko
Copy link
Copy Markdown
Contributor

leszko commented Mar 6, 2025

LGTM @rickstaa feel free to merge.

@rickstaa
Copy link
Copy Markdown
Member Author

rickstaa commented Mar 9, 2025

LGTM @rickstaa feel free to merge.

@leszko thanks. I now also tested the code without a reason.

@rickstaa rickstaa requested review from stronk-dev and thomshutt and removed request for stronk-dev and thomshutt March 9, 2025 09:40
rickstaa and others added 5 commits March 9, 2025 10:43
This commit allows orchestrators to vote on active treasury proposal
directly from the go-livepeer CLI.
This commit ensures that the contract bindings are up to date with the
latest version of the livepeer/protocol repository.
This commit renames the internal reference to the LivepeerGovernor
contract and improves the proposalVote handler data type parsing
behavoir.
This commit makes the CLI description for proposal voting more specific to prevent confusion.

Co-authored-by: Victor Elias <victor@livepeer.org>
@rickstaa rickstaa force-pushed the add_proposal_vote_cli_arg branch from 4a0fffc to 6caa873 Compare March 9, 2025 09:43
@rickstaa rickstaa merged commit 89d9ebc into master Mar 9, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants