Skip to content

Custom gas limit #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2025
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
3 changes: 2 additions & 1 deletion shared/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ func getWallet(c *cli.Context, cfg *config.StaderConfig, pm *passwords.PasswordM

chainId := cfg.StaderNode.GetChainID()

nodeWallet, err = wallet.NewWallet(os.ExpandEnv(cfg.StaderNode.GetWalletPath()), chainId, maxFee, maxPriorityFee, 0, pm)
gasLimit := c.GlobalUint64("gasLimit")
nodeWallet, err = wallet.NewWallet(os.ExpandEnv(cfg.StaderNode.GetWalletPath()), chainId, maxFee, maxPriorityFee, gasLimit, pm)
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion shared/services/stader/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@ func (c *Client) getGasOpts() string {
var opts string
opts += fmt.Sprintf("--maxFee %f ", c.maxFee)
opts += fmt.Sprintf("--maxPrioFee %f ", c.maxPrioFee)
opts += fmt.Sprintf("--gasLimit %d ", 100000)
opts += fmt.Sprintf("--gasLimit %d ", c.gasLimit)
return opts
}

Expand Down
4 changes: 4 additions & 0 deletions stader-cli/stader-cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,10 @@ Public License instead of this License. But first, please read
Name: "maxPrioFee, i",
Usage: "The max priority fee you want a transaction to use, in gwei",
},
cli.Uint64Flag{
Name: "gasLimit",
Usage: "Custom gas limit, using gas estimate if not specified",
},
cli.StringFlag{
Name: "nonce",
Usage: "Use this flag to explicitly specify the nonce that this transaction should use, so it can override an existing 'stuck' transaction",
Expand Down
2 changes: 1 addition & 1 deletion stader-lib/stader/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
// Transaction settings
const (
GasLimitMultiplier float64 = 1.5
MaxGasLimit uint64 = 50000000
MaxGasLimit uint64 = 30000000
)

// Contract type wraps go-ethereum bound contract
Expand Down
Loading