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

wrong result for eth_gasPrice #2136

Closed
sirpy opened this issue Jun 21, 2023 · 6 comments · Fixed by #2154
Closed

wrong result for eth_gasPrice #2136

sirpy opened this issue Jun 21, 2023 · 6 comments · Fixed by #2154
Assignees
Labels
component: rpc RPC API-related issues type:bug Something isn't working

Comments

@sirpy
Copy link

sirpy commented Jun 21, 2023

Expected Behavior

should return 5gwei or current baseFeePerGas

Actual Behavior

returns 25gwei

Steps to reproduce the behavior

curl https://forno.celo.org/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_gasPrice","params":[],"id":1,"jsonrpc":"2.0"}'

Seems to work fine on Baklava
Chain/Network: Alfajores/Mainnet

@sirpy sirpy added triage Issue needs triaging type:bug Something isn't working labels Jun 21, 2023
@palango
Copy link
Contributor

palango commented Jun 28, 2023

@sirpy Currently this endpoint returns a suggested gas price that works in the given network condition and not the base fee.

func GetGasPriceSuggestion(vmRunner vm.EVMRunner, currency *common.Address) (*big.Int, error) {
gasPriceMinimum, err := GetGasPriceMinimum(vmRunner, currency)
return new(big.Int).Mul(gasPriceMinimum, suggestionMultiplier), err
}

On baklava the values matches your expectation because the base fee is lower (1gwei) and the multipler is 5.

One solution to better handle this would be to create two endpoints, one for the base fee (similar to ethereum) and one for the suggested fee. What do you think about that?

@palango palango self-assigned this Jun 28, 2023
@sirpy
Copy link
Author

sirpy commented Jun 28, 2023

@palango sure, matching with ethereum standards would be best

@sirpy
Copy link
Author

sirpy commented Jun 28, 2023

@palango though i dont think on any other network the get gas price returns a multiplier of the current gas costs.
the 5x multiplier is also very very high, it should be something like 1.2
this causes users to pay 5x the gas!

@palango palango added component: rpc RPC API-related issues and removed triage Issue needs triaging labels Jul 7, 2023
@palango
Copy link
Contributor

palango commented Jul 7, 2023

@sirpy In the next release you will be able to change the multiplier with the --rpc.gaspricemultiplier option. The default changes two a factor of two, but maybe we will change that on forno.

Further changes to get closer to Ethereum are tracked in #2153

@sirpy
Copy link
Author

sirpy commented Jul 9, 2023

@palango
I don't think that's a solution as users and dapps dont use their own rpc.
They rely on forno or other providers.
Currently in many celo dapps users are paying 5x for gas

@palango
Copy link
Contributor

palango commented Jul 25, 2023

@sirpy Yes, we will reduce the multiplier on forno as well, but now people that run their own nodes can also adjust the multiplier themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: rpc RPC API-related issues type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants