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
8 changes: 0 additions & 8 deletions docker/rocketpool-prune-provision

This file was deleted.

25 changes: 10 additions & 15 deletions rocketpool-cli/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -975,28 +975,26 @@ func pruneExecutionClient(c *cli.Context) error {
fmt.Println("You are using Native Mode.\nThe Smart Node cannot prune your Execution client for you, you'll have to do it manually.")
}
selectedEc := cfg.ExecutionClient.Value.(cfgtypes.ExecutionClient)
switch selectedEc {
case cfgtypes.ExecutionClient_Besu:
if cfg.Besu.ArchiveMode.Value == true {
fmt.Println("You are using Besu as an archive node.\nArchive nodes should not be pruned. Aborting.")
return nil
}

// Don't prune besu if it's in archive mode
if selectedEc == cfgtypes.ExecutionClient_Besu && cfg.Besu.ArchiveMode.Value == true {
fmt.Println("You are using Besu as an archive node.\nArchive nodes should not be pruned. Aborting.")
return nil
}

if selectedEc == cfgtypes.ExecutionClient_Geth || selectedEc == cfgtypes.ExecutionClient_Besu {
if selectedEc == cfgtypes.ExecutionClient_Geth {
fmt.Printf("%sGeth has a new feature that renders pruning obsolete. However, as this is a new feature you may have to resync with `rocketpool service resync-eth1` before this takes effect.%s\n", colorYellow, colorReset)
}
// Print the appropriate warnings before pruning
if selectedEc == cfgtypes.ExecutionClient_Geth {
Comment thread
0xfornax marked this conversation as resolved.
fmt.Printf("%sGeth has a new feature that renders pruning obsolete. However, as this is a new feature you may have to resync with `rocketpool service resync-eth1` before this takes effect.%s\n", colorYellow, colorReset)
fmt.Println("This will shut down your main execution client and prune its database, freeing up disk space.")
if cfg.UseFallbackClients.Value == false {
fmt.Printf("%sYou do not have a fallback execution client configured.\nYour node will no longer be able to perform any validation duties (attesting or proposing blocks) until pruning is done.\nPlease configure a fallback client with `rocketpool service config` before running this.%s\n", colorRed, colorReset)
} else {
fmt.Println("You have fallback clients enabled. Rocket Pool (and your consensus client) will use that while the main client is pruning.")
}
fmt.Println("Once pruning is complete, your execution client will restart automatically.")
} else {
fmt.Println("This will request your main execution client to prune its database, freeing up disk space. This is a resource intensive operation and may lead to an increase in missed attestations until it finishes.")
}
fmt.Println("Once pruning is complete, your execution client will restart automatically.")
fmt.Println()

// Get the container prefix
Expand All @@ -1011,9 +1009,6 @@ func pruneExecutionClient(c *cli.Context) error {
return nil
}

// Get the prune provisioner image
pruneProvisioner := cfg.Smartnode.GetPruneProvisionerContainerTag()

// Get the execution container name
executionContainerName := prefix + ExecutionContainerSuffix

Expand Down Expand Up @@ -1074,7 +1069,7 @@ func pruneExecutionClient(c *cli.Context) error {

// Run the prune provisioner
fmt.Printf("Provisioning pruning on volume %s...\n", volume)
err = rp.RunPruneProvisioner(prefix+PruneProvisionerContainerSuffix, volume, pruneProvisioner)
err = rp.RunPruneProvisioner(prefix+PruneProvisionerContainerSuffix, volume)
if err != nil {
return fmt.Errorf("Error running prune provisioner: %w", err)
}
Expand Down
3 changes: 0 additions & 3 deletions rocketpool/prune_provision.sh

This file was deleted.

5 changes: 0 additions & 5 deletions shared/services/config/smartnode-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
// Constants
const (
smartnodeTag string = "rocketpool/smartnode:v" + shared.RocketPoolVersion
pruneProvisionerTag string = "rocketpool/eth1-prune-provision:v0.0.1"
NetworkID string = "network"
ProjectNameID string = "projectName"
SnapshotID string = "rocketpool-dao.eth"
Expand Down Expand Up @@ -745,10 +744,6 @@ func (cfg *SmartnodeConfig) GetSmartnodeContainerTag() string {
return smartnodeTag
}

func (config *SmartnodeConfig) GetPruneProvisionerContainerTag() string {
return pruneProvisionerTag
}

func (cfg *SmartnodeConfig) GetSnapshotApiDomain() string {
return cfg.snapshotApiDomain[cfg.Network.Value.(config.Network)]
}
Expand Down
4 changes: 2 additions & 2 deletions shared/services/rocketpool/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -851,10 +851,10 @@ func (c *Client) GetVolumeSize(volumeName string) (string, error) {
}

// Runs the prune provisioner
func (c *Client) RunPruneProvisioner(container string, volume string, image string) error {
func (c *Client) RunPruneProvisioner(container, volume string) error {

// Run the prune provisioner
cmd := fmt.Sprintf("docker run --rm --name %s -v %s:/ethclient %s", container, volume, image)
cmd := fmt.Sprintf("docker run --rm --name %s -v %s:/ethclient alpine:latest sh -c 'touch /ethclient/prune.lock'", container, volume)
Comment thread
0xfornax marked this conversation as resolved.
output, err := c.readOutput(cmd)
if err != nil {
return err
Expand Down
Loading