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

Simulated backend Rollback() function should set gas tip back to the parameter passed by config #30429

Open
dahu33 opened this issue Sep 13, 2024 · 2 comments
Labels

Comments

@dahu33
Copy link
Contributor

dahu33 commented Sep 13, 2024

System information

Geth version: 1.14.8
OS & Version: OSX

Expected behaviour

Calling the Rollback() function on the simulated backend should set gas tip back to parameter passed by config as it was the case before #28202 was merged.

Actual behaviour

Currently the gas tip is arbitrary set to 1 Gwei after calling the Rollback() function, which is not even the default config parameter (1 wei).

There is a TODO in the code left by @MariusVanDerWijden here:

// TODO (Marius van der Wijden): set gas tip to parameter passed by config
c.eth.TxPool().SetGasTip(big.NewInt(params.GWei))

Steps to reproduce the behaviour

  1. Create a new simulated client with the default values.
  2. Call Rollback()
  3. Make a TX using the suggested gas tip.

You will get the error transaction underpriced: gas tip cap 1000000, minimum needed 1000000000.

@rjl493456442
Copy link
Member

Would you like to submit the pull request to fix it?

@dahu33
Copy link
Contributor Author

dahu33 commented Sep 20, 2024

Would you like to submit the pull request to fix it?

Would love to but might need a bit of guidance on what would be the preferred strategy. I see two solutions so far:

  1. saving the gas tip value inside the TxPool struct and exposing a getter func (p *TxPool) GetGasTip() *big.Int
  2. saving the initial gas tip value inside the SimulatedBeacon struct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants