diff --git a/go.mod b/go.mod index a21adbbe..e551246a 100644 --- a/go.mod +++ b/go.mod @@ -15,8 +15,8 @@ require ( github.com/goccy/go-json v0.10.3 github.com/mholt/archiver/v4 v4.0.0-alpha.8 github.com/mitchellh/go-homedir v1.1.0 - github.com/nodeset-org/hyperdrive-constellation v1.0.1-0.20241029233158-396e2ad056fb - github.com/nodeset-org/hyperdrive-daemon v1.1.1-0.20241030071048-d42995c6c127 + github.com/nodeset-org/hyperdrive-constellation v1.0.1 + github.com/nodeset-org/hyperdrive-daemon v1.1.1 github.com/nodeset-org/hyperdrive-stakewise v1.1.0 github.com/nodeset-org/osha v0.3.1 github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 diff --git a/go.sum b/go.sum index 9772374b..1f03ef4a 100644 --- a/go.sum +++ b/go.sum @@ -448,10 +448,10 @@ github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOEL github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nodeset-org/hyperdrive-constellation v1.0.1-0.20241029233158-396e2ad056fb h1:5mKrL2y2qY20ddMhoh9c2RjcU/jzcWcHbl9ByRBMA9E= -github.com/nodeset-org/hyperdrive-constellation v1.0.1-0.20241029233158-396e2ad056fb/go.mod h1:KxQOIq+PbhhVkceEcN/7XLnfMVtboF2n6RTfYndSXy4= -github.com/nodeset-org/hyperdrive-daemon v1.1.1-0.20241030071048-d42995c6c127 h1:OYRL+3MA8QsUa1gzviYrc8TSdn+3hjLKom6FYgz3bXY= -github.com/nodeset-org/hyperdrive-daemon v1.1.1-0.20241030071048-d42995c6c127/go.mod h1:tzqdqfRR4Xcy4GtdSiEnfjOFj3+g4TvuZJpYljCQEBM= +github.com/nodeset-org/hyperdrive-constellation v1.0.1 h1:UWJAHR7fLS/40X7D+1lo2q9eqZ/S6eG7HsxXdsYuCHo= +github.com/nodeset-org/hyperdrive-constellation v1.0.1/go.mod h1:48noDjJIS5agKoZKVQ4fJC+N9pVcum+WJEp5UuM8tHc= +github.com/nodeset-org/hyperdrive-daemon v1.1.1 h1:aUQzEKmyuYhVTzn3AQEIdUm335xBYmsCTJfPdGNA5r0= +github.com/nodeset-org/hyperdrive-daemon v1.1.1/go.mod h1:tzqdqfRR4Xcy4GtdSiEnfjOFj3+g4TvuZJpYljCQEBM= github.com/nodeset-org/hyperdrive-stakewise v1.1.0 h1:JiquGP1ewiAcqJmas8Vz6x298rAA8n/0qIiqb8RmcyM= github.com/nodeset-org/hyperdrive-stakewise v1.1.0/go.mod h1:SqPlbylTPdKKq9gdm3JWHis/DOkFD9DOubHDC/MfQ6o= github.com/nodeset-org/nodeset-client-go v1.2.2 h1:mjJnH5uw/CF5TWdRxdU5+Cw/ERRLz4hl9VsRFVO0Wdo= diff --git a/hyperdrive-cli/utils/gas/gas.go b/hyperdrive-cli/utils/gas/gas.go index fd8dac44..2804d5c3 100644 --- a/hyperdrive-cli/utils/gas/gas.go +++ b/hyperdrive-cli/utils/gas/gas.go @@ -41,6 +41,10 @@ func GetMaxFees(c *cli.Context, hd *client.HyperdriveClient, simResult eth.Simul // Use the requested max fee and priority fee if provided if maxFeeGwei != 0 { + if maxPriorityFeeGwei > maxFeeGwei { + fmt.Printf("NOTE: Priority fee cannot be greater than max fee. Lowering priority fee to %.2f gwei.\n", maxFeeGwei) + maxPriorityFeeGwei = maxFeeGwei + } fmt.Printf("%sUsing the requested max fee of %.2f gwei (including a max priority fee of %.2f gwei).\n", terminal.ColorYellow, maxFeeGwei, maxPriorityFeeGwei) lowLimit := maxFeeGwei / eth.WeiPerGwei * float64(simResult.EstimatedGasLimit) highLimit := maxFeeGwei / eth.WeiPerGwei * float64(simResult.SafeGasLimit) @@ -71,13 +75,13 @@ func GetMaxFees(c *cli.Context, hd *client.HyperdriveClient, simResult eth.Simul } } } + if maxPriorityFeeGwei > maxFeeGwei { + fmt.Printf("NOTE: Priority fee cannot be greater than max fee. Lowering priority fee to %.2f gwei.\n", maxFeeGwei) + maxPriorityFeeGwei = maxFeeGwei + } fmt.Printf("%sUsing a max fee of %.2f gwei and a priority fee of %.2f gwei.\n%s", terminal.ColorBlue, maxFeeGwei, maxPriorityFeeGwei, terminal.ColorReset) } - if maxPriorityFeeGwei > maxFeeGwei { - return nil, nil, fmt.Errorf("Priority fee cannot be greater than max fee.") - } - // Verify the node has enough ETH to use this max fee maxFee := eth.GweiToWei(maxFeeGwei) ethRequired := big.NewInt(0).Mul(maxFee, big.NewInt(int64(simResult.SafeGasLimit)))