Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions bindings/network/voting.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,63 +88,6 @@ func GetNodeInfoSnapshotFast(rp *rocketpool.RocketPool, blockNumber uint32, mult
return votingInfos, nil
}

// Check whether or not on-chain voting has been initialized for the given node
func GetVotingInitialized(rp *rocketpool.RocketPool, address common.Address, opts *bind.CallOpts) (bool, error) {
rocketNetworkVoting, err := getRocketNetworkVoting(rp, nil)
if err != nil {
return false, err
}
value := new(bool)
if err := rocketNetworkVoting.Call(opts, value, "getVotingInitialised", address); err != nil {
return false, fmt.Errorf("error getting voting initialized status: %w", err)
}
return *value, nil
}

// Estimate the gas of InitializeVoting
func EstimateInitializeVotingGas(rp *rocketpool.RocketPool, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
rocketNetworkVoting, err := getRocketNetworkVoting(rp, nil)
if err != nil {
return rocketpool.GasInfo{}, err
}
return rocketNetworkVoting.GetTransactionGasInfo(opts, "initialiseVoting")
}

// Initialize on-chain voting for the node
func InitializeVoting(rp *rocketpool.RocketPool, opts *bind.TransactOpts) (common.Hash, error) {
rocketNetworkVoting, err := getRocketNetworkVoting(rp, nil)
if err != nil {
return common.Hash{}, err
}
tx, err := rocketNetworkVoting.Transact(opts, "initialiseVoting")
if err != nil {
return common.Hash{}, fmt.Errorf("error initializing voting: %w", err)
}
return tx.Hash(), nil
}

// Estimate the gas of InitializeVotingWithDelegate
func EstimateInitializeVotingWithDelegateGas(rp *rocketpool.RocketPool, delegateAddress common.Address, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
rocketNetworkVoting, err := getRocketNetworkVoting(rp, nil)
if err != nil {
return rocketpool.GasInfo{}, err
}
return rocketNetworkVoting.GetTransactionGasInfo(opts, "initialiseVotingWithDelegate", delegateAddress)
}

// Initialize on-chain voting for the node and delegate voting power at the same transaction
func InitializeVotingWithDelegate(rp *rocketpool.RocketPool, delegateAddress common.Address, opts *bind.TransactOpts) (common.Hash, error) {
rocketNetworkVoting, err := getRocketNetworkVoting(rp, nil)
if err != nil {
return common.Hash{}, err
}
tx, err := rocketNetworkVoting.Transact(opts, "initialiseVotingWithDelegate", delegateAddress)
if err != nil {
return common.Hash{}, fmt.Errorf("error initializing voting with delegate: %w", err)
}
return tx.Hash(), nil
}

// Get the number of nodes that were present in the network at the provided block
func GetVotingNodeCount(rp *rocketpool.RocketPool, blockNumber uint32, opts *bind.CallOpts) (*big.Int, error) {
rocketNetworkVoting, err := getRocketNetworkVoting(rp, nil)
Expand Down
5 changes: 0 additions & 5 deletions rocketpool-cli/network/dao-proposals.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,6 @@ func getActiveDAOProposals(c *cli.Context) error {

// Onchain Voting Status
fmt.Printf("%s=== Onchain Voting ===%s\n", colorGreen, colorReset)
if snapshotProposalsResponse.IsVotingInitialized {
fmt.Printf("The node %s%s%s has been initialized for onchain voting.\n", colorBlue, snapshotProposalsResponse.AccountAddressFormatted, colorReset)
} else {
fmt.Printf("The node %s%s%s has NOT been initialized for onchain voting. You need to run `rocketpool pdao initialize-voting` to participate in onchain votes.\n", colorBlue, snapshotProposalsResponse.AccountAddressFormatted, colorReset)
}

if snapshotProposalsResponse.OnchainVotingDelegate == blankAddress {
fmt.Println("The node doesn't have a delegate, which means it can vote directly on onchain proposals after it initializes voting.")
Expand Down
6 changes: 0 additions & 6 deletions rocketpool-cli/node/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,6 @@ func getStatus(c *cli.Context) error {

// Onchain voting status
fmt.Printf("%s=== Onchain Voting ===%s\n", colorGreen, colorReset)
if status.IsVotingInitialized {
fmt.Println("The node has been initialized for onchain voting.")

} else {
fmt.Println("The node has NOT been initialized for onchain voting. You need to run `rocketpool pdao initialize-voting` to participate in onchain votes.")
}

if status.OnchainVotingDelegate == blankAddress {
fmt.Println("The node doesn't have a delegate, which means it can vote directly on onchain proposals after it initializes voting.")
Expand Down
12 changes: 0 additions & 12 deletions rocketpool-cli/pdao/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,6 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {

},
},
{
Name: "initialize-voting",
Aliases: []string{"iv"},
Usage: "Unlocks a node operator's voting power (only required for node operators who registered before governance structure was in place)",
UsageText: "rocketpool pdao initialize-voting",
Action: func(c *cli.Context) error {

// Run
return initializeVotingPrompt(c)

},
},
{
Name: "set-signalling-address",
Aliases: []string{"ssa"},
Expand Down
68 changes: 0 additions & 68 deletions rocketpool-cli/pdao/initialize-voting-with-delegate.go

This file was deleted.

90 changes: 0 additions & 90 deletions rocketpool-cli/pdao/initialize-voting.go

This file was deleted.

5 changes: 0 additions & 5 deletions rocketpool-cli/pdao/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ func getStatus(c *cli.Context) error {

// Onchain Voting Status
fmt.Printf("%s=== Onchain Voting ===%s\n", colorGreen, colorReset)
if response.IsVotingInitialized {
fmt.Printf("The node %s%s%s has been initialized for onchain voting.\n", colorBlue, response.AccountAddressFormatted, colorReset)
} else {
fmt.Printf("The node %s%s%s has NOT been initialized for onchain voting. You need to run `rocketpool pdao initialize-voting` to participate in onchain votes.\n", colorBlue, response.AccountAddressFormatted, colorReset)
}

if response.OnchainVotingDelegate == blankAddress {
fmt.Println("The node doesn't have a delegate, which means it can vote directly on onchain proposals after it initializes voting.")
Expand Down
21 changes: 4 additions & 17 deletions rocketpool/api/network/dao-proposals.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package network
import (
"context"
"fmt"
"math/big"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -63,13 +62,6 @@ func getActiveDAOProposals(c *cli.Context) (*api.NetworkDAOProposalsResponse, er
var wg errgroup.Group
var blockNumber uint64

// Check if Voting is initialized and add to response
wg.Go(func() error {
var err error
response.IsVotingInitialized, err = network.GetVotingInitialized(rp, nodeAccount.Address, nil)
return err
})

// Get the node onchain voting delegate
wg.Go(func() error {
var err error
Expand Down Expand Up @@ -142,15 +134,10 @@ func getActiveDAOProposals(c *cli.Context) (*api.NetworkDAOProposalsResponse, er
return nil, err
}

// Get the delegated voting power if voting is initialized
if response.IsVotingInitialized {
totalDelegatedVP, _, _, err := propMgr.GetArtifactsForVoting(response.BlockNumber, nodeAccount.Address)
if err != nil {
return nil, err
}
response.TotalDelegatedVp = totalDelegatedVP
} else {
response.TotalDelegatedVp = big.NewInt(0)
// Get the delegated voting power
response.TotalDelegatedVp, _, _, err = propMgr.GetArtifactsForVoting(response.BlockNumber, nodeAccount.Address)
if err != nil {
return nil, err
}

// Get the local tree
Expand Down
7 changes: 0 additions & 7 deletions rocketpool/api/node/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,6 @@ func getStatus(c *cli.Context) (*api.NodeStatusResponse, error) {
})
}

// Check if Voting is Initialized
wg.Go(func() error {
var err error
response.IsVotingInitialized, err = network.GetVotingInitialized(rp, nodeAccount.Address, nil)
return err
})

// Get the node onchain voting delegate
wg.Go(func() error {
var err error
Expand Down
Loading
Loading