Repository navigation
Add --max-fee-per-gas - #1
Closed
techdigger wants to merge 5 commits into
Closed
techdigger wants to merge 5 commits into
techdigger wants to merge 5 commits into
Conversation
techdigger
force-pushed
the
pr/legacy-gas-price
branch
from
November 12, 2026 16:33
bf41ec1 to
b2d102e
Compare
safe-cli takes the fees of every transaction from eth_feeHistory: the next block's base fee plus the median tip. There is no way to change them. On chains whose fee history forecasts less than they charge (a fixed-fee chain whose node still projects a falling base fee) every transaction is refused, and on any chain you cannot pay more to be included sooner or to replace a pending transaction. Add two global options, for safe-cli (every command and the attended mode, anywhere on the command line) and safe-creator: --max-fee-per-gas cap of at least eth_gasPrice --max-fee-per-gas=<gwei> that cap --max-priority-fee-per-gas=<gwei> that tip SAFE_CLI_MAX_FEE_PER_GAS and SAFE_CLI_MAX_PRIORITY_FEE_PER_GAS set defaults; the command line overrides them. Transactions stay EIP-1559. The fees apply to approve_hash, to executing Safe transactions (local key or hardware wallet) and to deploying a Safe, and show in the confirmation prompt. safe-cli refuses a cap above 10 times the node's price, a tip above the cap, and the options on a network without EIP-1559, before sending anything. Without the options nothing changes.
techdigger
force-pushed
the
pr/legacy-gas-price
branch
from
November 12, 2026 17:36
b55f6d5 to
106cd52
Compare
Replace the fee options with one rule, in one place. EthereumClient.set_eip1559_fees takes maxFeePerGas from eth_feeHistory: the next block's forecast base fee plus the tip. A chain that charges more than its fee history forecasts (a fixed-fee chain whose node still projects a falling base fee) refuses such a transaction. There the node's eth_gasPrice is above the forecast, and it becomes the cap. Where the forecast is at or above eth_gasPrice, nothing changes. One override of set_eip1559_fees, in a subclass SafeOperator constructs, covers execution with a local key, approve_hash and execution with a hardware wallet. No options, and safe-creator is unchanged.
Without the option safe-cli behaves exactly as before. --max-fee-per-gas GWEI (or SAFE_CLI_MAX_FEE_PER_GAS) sets maxFeePerGas for every transaction safe-cli sends, instead of the estimate from eth_feeHistory: for a chain that refuses that estimate (a fixed-fee chain whose node forecasts less than it charges), or to raise the cap on a busy chain. Transactions stay EIP-1559 and the tip stays the estimate. A cap above 10 times the node's gas price is refused before anything is sent, a guard against typing mistakes. One override of EthereumClient.set_eip1559_fees, in a subclass SafeOperator constructs, covers execution with a local key, approve_hash and execution with a hardware wallet. The option is global: it goes before the command or the Safe address.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaced by #7: the same code as one commit on a clean branch.