Skip to content

Let the user set maxFeePerGas - #10

Open
techdigger wants to merge 1 commit into
mainfrom
max-fee-per-gas-env
Open

techdigger wants to merge 1 commit into
mainfrom
max-fee-per-gas-env

Conversation

@techdigger

@techdigger techdigger commented Nov 12, 2026 •

Copy link
Copy Markdown
  • Ran the tests
  • Ran pre-commit on the changed files

What was wrong?

safe-cli picks maxFeePerGas itself and gives no way to set it. Other tools let you: cast send has --gas-price.

How was it fixed?

  • SAFE_CLI_MAX_FEE_PER_GAS=<gwei> sets maxFeePerGas for the transactions safe-cli sends. When unset, nothing changes.
  • The limit is 9.9 times the node's gas price, so one extra zero is refused.
  • The tip stays the estimate.
  • No effect on networks without EIP-1559 fees. safe-creator does not read it.
  • README and tests.

safe-cli takes maxFeePerGas from eth_feeHistory and gives the user no way
to change it. A network that charges more than its fee history forecasts
refuses each transaction safe-cli sends, and on a busy network the user
may want a higher cap.

The environment variable SAFE_CLI_MAX_FEE_PER_GAS, in gwei, sets
maxFeePerGas for the EIP-1559 transactions safe-cli sends: execution with
a local key, approve_hash and execution with a hardware wallet. The tip
stays the estimate, lowered to the cap if needed. Without the variable
safe-cli behaves as before and makes no extra request.

safe-cli refuses a value that is not a positive decimal number when it
starts. When it sends, it refuses a cap of 9.9 times the node's gas price
or more, which catches one zero too many.
@techdigger techdigger mentioned this pull request Nov 12, 2026
@techdigger techdigger changed the title Add SAFE_CLI_MAX_FEE_PER_GAS Support setting maxFeePerGas with SAFE_CLI_MAX_FEE_PER_GAS Nov 12, 2026
@techdigger techdigger changed the title Support setting maxFeePerGas with SAFE_CLI_MAX_FEE_PER_GAS Let the user set maxFeePerGas Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant