Skip to content

Commit b9edf2b

Browse files
authored
Merge pull request #792 from jshufro/jms/pruneprovisioner
Deprecate prune-provisioner container
2 parents 0107eba + b415b59 commit b9edf2b

5 files changed

Lines changed: 12 additions & 33 deletions

File tree

docker/rocketpool-prune-provision

Lines changed: 0 additions & 8 deletions
This file was deleted.

rocketpool-cli/service/service.go

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -975,28 +975,26 @@ func pruneExecutionClient(c *cli.Context) error {
975975
fmt.Println("You are using Native Mode.\nThe Smart Node cannot prune your Execution client for you, you'll have to do it manually.")
976976
}
977977
selectedEc := cfg.ExecutionClient.Value.(cfgtypes.ExecutionClient)
978-
switch selectedEc {
979-
case cfgtypes.ExecutionClient_Besu:
980-
if cfg.Besu.ArchiveMode.Value == true {
981-
fmt.Println("You are using Besu as an archive node.\nArchive nodes should not be pruned. Aborting.")
982-
return nil
983-
}
978+
979+
// Don't prune besu if it's in archive mode
980+
if selectedEc == cfgtypes.ExecutionClient_Besu && cfg.Besu.ArchiveMode.Value == true {
981+
fmt.Println("You are using Besu as an archive node.\nArchive nodes should not be pruned. Aborting.")
982+
return nil
984983
}
985984

986-
if selectedEc == cfgtypes.ExecutionClient_Geth || selectedEc == cfgtypes.ExecutionClient_Besu {
987-
if selectedEc == cfgtypes.ExecutionClient_Geth {
988-
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)
989-
}
985+
// Print the appropriate warnings before pruning
986+
if selectedEc == cfgtypes.ExecutionClient_Geth {
987+
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)
990988
fmt.Println("This will shut down your main execution client and prune its database, freeing up disk space.")
991989
if cfg.UseFallbackClients.Value == false {
992990
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)
993991
} else {
994992
fmt.Println("You have fallback clients enabled. Rocket Pool (and your consensus client) will use that while the main client is pruning.")
995993
}
994+
fmt.Println("Once pruning is complete, your execution client will restart automatically.")
996995
} else {
997996
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.")
998997
}
999-
fmt.Println("Once pruning is complete, your execution client will restart automatically.")
1000998
fmt.Println()
1001999

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

1014-
// Get the prune provisioner image
1015-
pruneProvisioner := cfg.Smartnode.GetPruneProvisionerContainerTag()
1016-
10171012
// Get the execution container name
10181013
executionContainerName := prefix + ExecutionContainerSuffix
10191014

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

10751070
// Run the prune provisioner
10761071
fmt.Printf("Provisioning pruning on volume %s...\n", volume)
1077-
err = rp.RunPruneProvisioner(prefix+PruneProvisionerContainerSuffix, volume, pruneProvisioner)
1072+
err = rp.RunPruneProvisioner(prefix+PruneProvisionerContainerSuffix, volume)
10781073
if err != nil {
10791074
return fmt.Errorf("Error running prune provisioner: %w", err)
10801075
}

rocketpool/prune_provision.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

shared/services/config/smartnode-config.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
// Constants
1414
const (
1515
smartnodeTag string = "rocketpool/smartnode:v" + shared.RocketPoolVersion
16-
pruneProvisionerTag string = "rocketpool/eth1-prune-provision:v0.0.1"
1716
NetworkID string = "network"
1817
ProjectNameID string = "projectName"
1918
SnapshotID string = "rocketpool-dao.eth"
@@ -745,10 +744,6 @@ func (cfg *SmartnodeConfig) GetSmartnodeContainerTag() string {
745744
return smartnodeTag
746745
}
747746

748-
func (config *SmartnodeConfig) GetPruneProvisionerContainerTag() string {
749-
return pruneProvisionerTag
750-
}
751-
752747
func (cfg *SmartnodeConfig) GetSnapshotApiDomain() string {
753748
return cfg.snapshotApiDomain[cfg.Network.Value.(config.Network)]
754749
}

shared/services/rocketpool/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,10 +847,10 @@ func (c *Client) GetVolumeSize(volumeName string) (string, error) {
847847
}
848848

849849
// Runs the prune provisioner
850-
func (c *Client) RunPruneProvisioner(container string, volume string, image string) error {
850+
func (c *Client) RunPruneProvisioner(container, volume string) error {
851851

852852
// Run the prune provisioner
853-
cmd := fmt.Sprintf("docker run --rm --name %s -v %s:/ethclient %s", container, volume, image)
853+
cmd := fmt.Sprintf("docker run --rm --name %s -v %s:/ethclient alpine:latest sh -c 'touch /ethclient/prune.lock'", container, volume)
854854
output, err := c.readOutput(cmd)
855855
if err != nil {
856856
return err

0 commit comments

Comments
 (0)