Skip to content

Commit 93ece66

Browse files
authored
Merge pull request #228 from stader-labs/custom_galimit
Custom gas limit
2 parents 43b42fa + fa7d889 commit 93ece66

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

shared/services/services.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,8 @@ func getWallet(c *cli.Context, cfg *config.StaderConfig, pm *passwords.PasswordM
508508

509509
chainId := cfg.StaderNode.GetChainID()
510510

511-
nodeWallet, err = wallet.NewWallet(os.ExpandEnv(cfg.StaderNode.GetWalletPath()), chainId, maxFee, maxPriorityFee, 0, pm)
511+
gasLimit := c.GlobalUint64("gasLimit")
512+
nodeWallet, err = wallet.NewWallet(os.ExpandEnv(cfg.StaderNode.GetWalletPath()), chainId, maxFee, maxPriorityFee, gasLimit, pm)
512513
if err != nil {
513514
return
514515
}

shared/services/stader/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1715,7 +1715,7 @@ func (c *Client) getGasOpts() string {
17151715
var opts string
17161716
opts += fmt.Sprintf("--maxFee %f ", c.maxFee)
17171717
opts += fmt.Sprintf("--maxPrioFee %f ", c.maxPrioFee)
1718-
opts += fmt.Sprintf("--gasLimit %d ", 100000)
1718+
opts += fmt.Sprintf("--gasLimit %d ", c.gasLimit)
17191719
return opts
17201720
}
17211721

stader-cli/stader-cli.go

+4
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,10 @@ Public License instead of this License. But first, please read
756756
Name: "maxPrioFee, i",
757757
Usage: "The max priority fee you want a transaction to use, in gwei",
758758
},
759+
cli.Uint64Flag{
760+
Name: "gasLimit",
761+
Usage: "Custom gas limit, using gas estimate if not specified",
762+
},
759763
cli.StringFlag{
760764
Name: "nonce",
761765
Usage: "Use this flag to explicitly specify the nonce that this transaction should use, so it can override an existing 'stuck' transaction",

stader-lib/stader/contract.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
// Transaction settings
3838
const (
3939
GasLimitMultiplier float64 = 1.5
40-
MaxGasLimit uint64 = 50000000
40+
MaxGasLimit uint64 = 30000000
4141
)
4242

4343
// Contract type wraps go-ethereum bound contract

0 commit comments

Comments
 (0)