Skip to content
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

cast send: add --bump-fee flag that resends with iteratively increasing gas price #4454

Open
Thegaram opened this issue Mar 1, 2023 · 10 comments · May be fixed by #9147
Open

cast send: add --bump-fee flag that resends with iteratively increasing gas price #4454

Thegaram opened this issue Mar 1, 2023 · 10 comments · May be fixed by #9147
Assignees
Labels
C-cast Command: cast good first issue Good for newcomers T-feature Type: feature

Comments

@Thegaram
Copy link

Thegaram commented Mar 1, 2023

Component

Cast

Describe the feature you would like

I'm using cast send extensively in some scripts. Sometimes they fail with replacement transaction underpriced. I suggest having a flag that allows bumping the gas price automatically so that the script can replace the stuck transaction.

  • Option A: --bump-fee. If the transaction encounters the above error, we try resending it with iteratively increasing gas price (e.g. +10%) until we succeed.
  • Option B: --bump-fee <MAX_GAS_PRICE>. Same as above but provide an upper limit.

I can take a go at implementing this if you think this would be a useful feature.

Additional context

No response

@Thegaram Thegaram added the T-feature Type: feature label Mar 1, 2023
@gakonst gakonst added this to Foundry Mar 1, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Mar 1, 2023
@mattsse
Copy link
Member

mattsse commented Mar 1, 2023

we have --gas-estimate-multiplier in script which we can easily integrate here as well

@mattsse mattsse added the good first issue Good for newcomers label Mar 1, 2023
@karpa4o4
Copy link

@mattsse, I would like to pick this up. Could you give me some advice on how to solve this issue?

@hackermayor1
Copy link

hackermayor1 commented May 6, 2023

@mattsse @Thegaram
I would like to pick this up!

Just some pointers I thought about before starting this:

  1. Where do we store the fee (maxGas) in storage, so we can iteratively bump next time?
  2. How do we reset fee after bumping? This is what I am proposing:
    1. If any send call succeeds, we reset the state
    2. Else, we continuously increment if the bump-fee flag is passed

@Evalir
Copy link
Member

Evalir commented May 6, 2023

Just a note @hackermayor1#4874 will add some changes to cast send that might affect your PR.

@andyrobert3
Copy link
Contributor

@Evalir any thoughts from the questions raised by @hackermayor1

I would like to pick this up!

Just some pointers I thought about before starting this:

Where do we store the fee (maxGas) in storage, so we can iteratively bump next time?
How do we reset fee after bumping? This is what I am proposing:
If any send call succeeds, we reset the state
Else, we continuously increment if the bump-fee flag is passed

@zerosnacks zerosnacks added the C-cast Command: cast label Jul 1, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@zerosnacks
Copy link
Member

Closing in favor of #1803

@zerosnacks zerosnacks closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2024
@Thegaram
Copy link
Author

Thegaram commented Aug 2, 2024

Hi @zerosnacks, these two seems to be different features. #1803 is a static, one-time multiplier, while this issue requests a way to automatically resend a transaction with a higher gas price.

@zerosnacks zerosnacks reopened this Aug 2, 2024
@zerosnacks zerosnacks changed the title cast send: add --bump-fee flag cast send: add --bump-fee flag that resends with iteratively increasing gas price Aug 2, 2024
@grandizzy grandizzy removed this from the v1.0.0 milestone Oct 8, 2024
@leovct
Copy link
Contributor

leovct commented Oct 10, 2024

I'm interested!

@zerosnacks
Copy link
Member

I'm interested!

Assigned!

Related: #9067, this is a static multiplier for gas price for forge script / forge test whereas this ticket proposes an iteratively bumping up to a limit in cast

I think the ability to specify a max limit as proposed is important for safety / control

@leovct
Copy link
Contributor

leovct commented Oct 10, 2024

I'm interested!

Assigned!

Related: #9067, this is a static multiplier for gas price for forge script / forge test whereas this ticket proposes an iteratively bumping up to a limit in cast

I think the ability to specify a max limit as proposed is important for safety / control

I agree, we should implement safeguards. I was thinking of the following:

  • Gas price limit (by default, could be set to 150% or 200% of the initial gas price)
  • Maximum number of bumps (default: 5) or set a timeout (default: 1 min for example)
  • Configurable bump increase (default: 10%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast good first issue Good for newcomers T-feature Type: feature
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

9 participants