Fix gas estimate and command issues #138
Open
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.
Description
Because in rust ethers, the
eip1559_default_estimator
will set a high base_fee_per_gas and priority_fee toEIP1559_FEE_ESTIMATION_DEFAULT_PRIORITY_FEE
(3_000_000_000) if network fee lower than this default value (EIP1559_FEE_ESTIMATION_PRIORITY_FEE_TRIGGER
, 100_000_000_000), however, on arbitrum, the network fee is significant lower than this. And if the cli tool use this default fee to send tx which will cause the tx body's gas fee set super higher than what it actually needs and might lead to tx failed if users don't have that much balance in wallet.Also, for
--max-fee-per-gas-gwei
config, it uses u128, however, user might input like0.02
value, so we need to reset it to string and use a method to convert it.