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
4 changes: 2 additions & 2 deletions rocketpool/node/defend-challenge-exit.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ func newDefendChallengeExit(c *cli.Context, logger log.ColorLogger) (*defendChal
priorityFeeGwei := cfg.Smartnode.PriorityFee.Value.(float64)
var priorityFee *big.Int
if priorityFeeGwei == 0 {
logger.Println("WARNING: priority fee was missing or 0, setting a default of 2.")
priorityFee = eth.GweiToWei(2)
logger.Printlnf("WARNING: priority fee was missing or 0, setting a default of %.2f.", rpgas.DefaultPriorityFeeGwei)
priorityFee = eth.GweiToWei(rpgas.DefaultPriorityFeeGwei)
} else {
priorityFee = eth.GweiToWei(priorityFeeGwei)
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/node/defend-pdao-props.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ func newDefendPdaoProps(c *cli.Context, logger log.ColorLogger) (*defendPdaoProp
priorityFeeGwei := cfg.Smartnode.PriorityFee.Value.(float64)
var priorityFee *big.Int
if priorityFeeGwei == 0 {
logger.Println("WARNING: priority fee was missing or 0, setting a default of 2.")
priorityFee = eth.GweiToWei(2)
logger.Printlnf("WARNING: priority fee was missing or 0, setting a default of %.2f.", rpgas.DefaultPriorityFeeGwei)
priorityFee = eth.GweiToWei(rpgas.DefaultPriorityFeeGwei)
} else {
priorityFee = eth.GweiToWei(priorityFeeGwei)
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/node/distribute-minipools.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ func newDistributeMinipools(c *cli.Context, logger log.ColorLogger) (*distribute
priorityFeeGwei := cfg.Smartnode.PriorityFee.Value.(float64)
var priorityFee *big.Int
if priorityFeeGwei == 0 {
logger.Println("WARNING: priority fee was missing or 0, setting a default of 2.")
priorityFee = eth.GweiToWei(2)
logger.Printlnf("WARNING: priority fee was missing or 0, setting a default of %.2f.", rpgas.DefaultPriorityFeeGwei)
priorityFee = eth.GweiToWei(rpgas.DefaultPriorityFeeGwei)
} else {
priorityFee = eth.GweiToWei(priorityFeeGwei)
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/node/notify-final-balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func newNotifyFinalBalance(c *cli.Context, logger log.ColorLogger) (*notifyFinal
priorityFeeGwei := cfg.Smartnode.PriorityFee.Value.(float64)
var priorityFee *big.Int
if priorityFeeGwei == 0 {
logger.Println("WARNING: priority fee was missing or 0, setting a default of 2.")
priorityFee = eth.GweiToWei(2)
logger.Printlnf("WARNING: priority fee was missing or 0, setting a default of %.2f.", rpgas.DefaultPriorityFeeGwei)
priorityFee = eth.GweiToWei(rpgas.DefaultPriorityFeeGwei)
} else {
priorityFee = eth.GweiToWei(priorityFeeGwei)
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/node/notify-validator-exit.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ func newNotifyValidatorExit(c *cli.Context, logger log.ColorLogger) (*notifyVali
priorityFeeGwei := cfg.Smartnode.PriorityFee.Value.(float64)
var priorityFee *big.Int
if priorityFeeGwei == 0 {
logger.Println("WARNING: priority fee was missing or 0, setting a default of 2.")
priorityFee = eth.GweiToWei(2)
logger.Printlnf("WARNING: priority fee was missing or 0, setting a default of %.2f.", rpgas.DefaultPriorityFeeGwei)
priorityFee = eth.GweiToWei(rpgas.DefaultPriorityFeeGwei)
} else {
priorityFee = eth.GweiToWei(priorityFeeGwei)
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/node/prestake-megapool-validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ func newPrestakeMegapoolValidator(c *cli.Context, logger log.ColorLogger) (*pres
priorityFeeGwei := cfg.Smartnode.PriorityFee.Value.(float64)
var priorityFee *big.Int
if priorityFeeGwei == 0 {
logger.Println("WARNING: priority fee was missing or 0, setting a default of 2.")
priorityFee = eth.GweiToWei(2)
logger.Printlnf("WARNING: priority fee was missing or 0, setting a default of %.2f.", rpgas.DefaultPriorityFeeGwei)
priorityFee = eth.GweiToWei(rpgas.DefaultPriorityFeeGwei)
} else {
priorityFee = eth.GweiToWei(priorityFeeGwei)
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/node/promote-minipools.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func newPromoteMinipools(c *cli.Context, logger log.ColorLogger) (*promoteMinipo
priorityFeeGwei := cfg.Smartnode.PriorityFee.Value.(float64)
var priorityFee *big.Int
if priorityFeeGwei == 0 {
logger.Println("WARNING: priority fee was missing or 0, setting a default of 2.")
priorityFee = eth.GweiToWei(2)
logger.Printlnf("WARNING: priority fee was missing or 0, setting a default of %.2f.", rpgas.DefaultPriorityFeeGwei)
priorityFee = eth.GweiToWei(rpgas.DefaultPriorityFeeGwei)
} else {
priorityFee = eth.GweiToWei(priorityFeeGwei)
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/node/provision-express-tickets.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func newProvisionExpressTickets(c *cli.Context, logger log.ColorLogger) (*provis
priorityFeeGwei := cfg.Smartnode.PriorityFee.Value.(float64)
var priorityFee *big.Int
if priorityFeeGwei == 0 {
logger.Println("WARNING: priority fee was missing or 0, setting a default of 2.")
priorityFee = eth.GweiToWei(2)
logger.Printlnf("WARNING: priority fee was missing or 0, setting a default of %.2f.", rpgas.DefaultPriorityFeeGwei)
priorityFee = eth.GweiToWei(rpgas.DefaultPriorityFeeGwei)
} else {
priorityFee = eth.GweiToWei(priorityFeeGwei)
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/node/reduce-bonds.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ func newReduceBonds(c *cli.Context, logger log.ColorLogger) (*reduceBonds, error
priorityFeeGwei := cfg.Smartnode.PriorityFee.Value.(float64)
var priorityFee *big.Int
if priorityFeeGwei == 0 {
logger.Println("WARNING: priority fee was missing or 0, setting a default of 2.")
priorityFee = eth.GweiToWei(2)
logger.Printlnf("WARNING: priority fee was missing or 0, setting a default of %.2f.", rpgas.DefaultPriorityFeeGwei)
priorityFee = eth.GweiToWei(rpgas.DefaultPriorityFeeGwei)
} else {
priorityFee = eth.GweiToWei(priorityFeeGwei)
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/node/stake-megapool-validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ func newStakeMegapoolValidator(c *cli.Context, logger log.ColorLogger) (*stakeMe
priorityFeeGwei := cfg.Smartnode.PriorityFee.Value.(float64)
var priorityFee *big.Int
if priorityFeeGwei == 0 {
logger.Println("WARNING: priority fee was missing or 0, setting a default of 2.")
priorityFee = eth.GweiToWei(2)
logger.Printlnf("WARNING: priority fee was missing or 0, setting a default of %.2f.", rpgas.DefaultPriorityFeeGwei)
priorityFee = eth.GweiToWei(rpgas.DefaultPriorityFeeGwei)
} else {
priorityFee = eth.GweiToWei(priorityFeeGwei)
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/node/stake-prelaunch-minipools.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ func newStakePrelaunchMinipools(c *cli.Context, logger log.ColorLogger) (*stakeP
priorityFeeGwei := cfg.Smartnode.PriorityFee.Value.(float64)
var priorityFee *big.Int
if priorityFeeGwei == 0 {
logger.Println("WARNING: priority fee was missing or 0, setting a default of 2.")
priorityFee = eth.GweiToWei(2)
logger.Printlnf("WARNING: priority fee was missing or 0, setting a default of %.2f.", rpgas.DefaultPriorityFeeGwei)
priorityFee = eth.GweiToWei(rpgas.DefaultPriorityFeeGwei)
} else {
priorityFee = eth.GweiToWei(priorityFeeGwei)
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/node/verify-pdao-props.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ func newVerifyPdaoProps(c *cli.Context, logger log.ColorLogger) (*verifyPdaoProp
priorityFeeGwei := cfg.Smartnode.PriorityFee.Value.(float64)
var priorityFee *big.Int
if priorityFeeGwei == 0 {
logger.Println("WARNING: priority fee was missing or 0, setting a default of 2.")
priorityFee = eth.GweiToWei(2)
logger.Printlnf("WARNING: priority fee was missing or 0, setting a default of %.2f.", rpgas.DefaultPriorityFeeGwei)
priorityFee = eth.GweiToWei(rpgas.DefaultPriorityFeeGwei)
} else {
priorityFee = eth.GweiToWei(priorityFeeGwei)
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/watchtower/process-penalties.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func newProcessPenalties(c *cli.Context, logger log.ColorLogger, errorLogger log
priorityFeeGwei := cfg.Smartnode.PriorityFee.Value.(float64)
var priorityFee *big.Int
if priorityFeeGwei == 0 {
logger.Println("WARNING: priority fee was missing or 0, setting a default of 2.")
priorityFee = eth.GweiToWei(2)
logger.Printlnf("WARNING: priority fee was missing or 0, setting a default of %.2f.", rpgas.DefaultPriorityFeeGwei)
priorityFee = eth.GweiToWei(rpgas.DefaultPriorityFeeGwei)
} else {
priorityFee = eth.GweiToWei(priorityFeeGwei)
}
Expand Down
8 changes: 8 additions & 0 deletions shared/services/config/migration/migration-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func UpdateConfig(serializedConfig map[string]map[string]string) error {
if err != nil {
return err
}
v1189, err := parseVersion("1.18.9")
if err != nil {
return err
}

// Create the collection of upgraders
upgraders := []ConfigUpgrader{
Expand All @@ -61,6 +65,10 @@ func UpdateConfig(serializedConfig map[string]map[string]string) error {
Version: v1160,
UpgradeFunc: upgradeFromV1160,
},
{
Version: v1189,
UpgradeFunc: upgradeFromV1189,
},
}

// Find the index of the provided config's version
Expand Down
17 changes: 17 additions & 0 deletions shared/services/config/migration/v1189-manager.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package migration

func upgradeFromV1189(serializedConfig map[string]map[string]string) error {

// If the previous priority fee is 2, set it to 0.01
priorityFee, exists := serializedConfig["smartnode"]["priorityFee"]
if exists && priorityFee == "2" {
serializedConfig["smartnode"]["priorityFee"] = "0.01"
}

// If the previous auto tx gas threshold is 150, set it to 20
autoTxGasThreshold, exists := serializedConfig["smartnode"]["minipoolStakeGasThreshold"]
if exists && autoTxGasThreshold == "150" {
serializedConfig["smartnode"]["minipoolStakeGasThreshold"] = "20"
}
return nil
}
2 changes: 1 addition & 1 deletion shared/services/gas/etherscan/etherscan.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/goccy/go-json"
)

const gasOracleUrl string = "https://api.etherscan.io/v2/api?chainid=%1&module=gastracker&action=gasoracle"
const gasOracleUrl string = "https://api.etherscan.io/v2/api?chainid=1&module=gastracker&action=gasoracle"

// Standard response
type gasOracleResponse struct {
Expand Down
3 changes: 3 additions & 0 deletions shared/services/gas/gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const colorReset string = "\033[0m"
const colorYellow string = "\033[33m"
const colorBlue string = "\033[36m"

// DefaultPriorityFeeGwei is the default priority fee in gwei used for automatic transactions
const DefaultPriorityFeeGwei float64 = 0.01

type Gas struct {
maxFeeGwei float64
maxPriorityFeeGwei float64
Expand Down
Loading