Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1 revert close requirement on 16eth minipools with uninitialized vp #707

Merged
merged 4 commits into from
Nov 26, 2024
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
10 changes: 0 additions & 10 deletions rocketpool-cli/minipool/close.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func closeMinipools(c *cli.Context) error {
return nil
}

hasOnly16ETHMps := true
closableMinipools := []api.MinipoolCloseDetails{}
versionTooLowMinipools := []api.MinipoolCloseDetails{}
balanceLessThanRefundMinipools := []api.MinipoolCloseDetails{}
Expand All @@ -59,9 +58,6 @@ func closeMinipools(c *cli.Context) error {
// Ignore minipools that are currently in prelaunch
continue
}
if eth.WeiToEth(mp.DepositBalance) != 16 {
hasOnly16ETHMps = false
}
if mp.CanClose {
closableMinipools = append(closableMinipools, mp)
} else {
Expand All @@ -78,12 +74,6 @@ func closeMinipools(c *cli.Context) error {
}
}

// TODO: remove after contract fix
if !details.IsVotingInitialized && hasOnly16ETHMps {
fmt.Println("Your node only has 16 ETH minipools] and, as a temporary measure, minipools should not be closed until your node has initialized voting power. \nPlease run `rocketpool pdao initialize-voting` first, then return here to close your minipools.")
return nil
}

// Print ineligible ones
if len(unwithdrawnMinipools) > 0 {
fmt.Printf("%sNOTE: The following minipools have not had their full balances withdrawn from the Beacon Chain yet:\n", colorBlue)
Expand Down
18 changes: 0 additions & 18 deletions rocketpool/api/minipool/close.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/rocket-pool/rocketpool-go/minipool"
"github.com/rocket-pool/rocketpool-go/network"
"github.com/rocket-pool/rocketpool-go/node"
"github.com/rocket-pool/rocketpool-go/rocketpool"
"github.com/rocket-pool/rocketpool-go/types"
Expand Down Expand Up @@ -58,14 +57,6 @@ func getMinipoolCloseDetailsForNode(c *cli.Context) (*api.GetMinipoolCloseDetail
return &response, nil
}

response.IsVotingInitialized, err = network.GetVotingInitialized(rp, nodeAccount.Address, nil)
if err != nil {
return nil, fmt.Errorf("error checking if the node has initialized voting: %w", err)
}
if !response.IsVotingInitialized {
return &response, nil
}

// Get the minipool addresses for this node
addresses, err := minipool.GetNodeMinipoolAddresses(rp, nodeAccount.Address, nil)
if err != nil {
Expand Down Expand Up @@ -213,15 +204,6 @@ func getMinipoolCloseDetails(rp *rocketpool.RocketPool, minipoolAddress common.A
}
return nil
})
wg1.Go(func() error {
var err error
nodeDetails, err := mp.GetNodeDetails(nil)
if err != nil {
return fmt.Errorf("error getting minipool details %s: %w", minipoolAddress.Hex(), err)
}
details.DepositBalance = nodeDetails.DepositBalance
return nil
})

if err := wg1.Wait(); err != nil {
return api.MinipoolCloseDetails{}, err
Expand Down
2 changes: 0 additions & 2 deletions shared/types/api/minipool.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ type MinipoolCloseDetails struct {
Balance *big.Int `json:"balance"`
Refund *big.Int `json:"refund"`
UserDepositBalance *big.Int `json:"userDepositBalance"`
DepositBalance *big.Int `json:"depositBalance"`
BeaconState beacon.ValidatorState `json:"beaconState"`
NodeShare *big.Int `json:"nodeShare"`
GasInfo rocketpool.GasInfo `json:"gasInfo"`
Expand All @@ -162,7 +161,6 @@ type GetMinipoolCloseDetailsForNodeResponse struct {
Status string `json:"status"`
Error string `json:"error"`
IsFeeDistributorInitialized bool `json:"isFeeDistributorInitialized"`
IsVotingInitialized bool `json:"isVotingInitialized"`
Details []MinipoolCloseDetails `json:"details"`
}
type CloseMinipoolResponse struct {
Expand Down
Loading