go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

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

Open dahu33 opened this issue 1 year ago • 2 comments

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 https://github.com/ethereum/go-ethereum/pull/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: https://github.com/ethereum/go-ethereum/blob/a9523b6428238a762e1a1e55e46ead47630c3a23/eth/catalyst/simulated_beacon.go#L276-L277

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.

dahu33 avatar Sep 13 '24 07:09 dahu33

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

rjl493456442 avatar Sep 19 '24 08:09 rjl493456442

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

dahu33 avatar Sep 20 '24 09:09 dahu33

Was this issue addressed by #30534?

shoenseiwaso avatar Nov 25 '24 03:11 shoenseiwaso

Yes, thank you closing this

MariusVanDerWijden avatar Nov 25 '24 04:11 MariusVanDerWijden