Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

GasPriceLowerThanBaseFee errors on eth_call #446

Closed
KaiRo-at opened this issue Jun 24, 2021 · 11 comments · Fixed by #460
Closed

GasPriceLowerThanBaseFee errors on eth_call #446

KaiRo-at opened this issue Jun 24, 2021 · 11 comments · Fixed by #460
Assignees
Labels

Comments

@KaiRo-at
Copy link

KaiRo-at commented Jun 24, 2021

  • OpenEthereum version (>=3.1.0): 3.3.0-rc2
  • Operating system: Linux
  • Installation: docker
  • Fully synchronized: yes
  • Network: ropsten
  • Restarted: yes

When doing eth_call on Ropsten, now that London is enabled, I always get a GasPriceLowerThanBaseFee error, see e.g. this direct JSON-RPC call via curl:

> curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to": "0x588Ca95d76c6a7ab121746bd209F2994B7Ba5F10", "data": "0x63a6344e"}, "latest"],"id":67}' http://localhost:8545
{"jsonrpc":"2.0","error":{"code":-32015,"message":"Transaction execution error.","data":"GasPriceLowerThanBaseFee { gas_price: 0, base_fee: 159911300881 }"},"id":67}

When I do this call on Infura instead, it works as expected:

> curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to": "0x588Ca95d76c6a7ab121746bd209F2994B7Ba5F10", "data": "0x63a6344e"}, "latest"],"id":67}' https://ropsten.infura.io/v3/...
{"jsonrpc":"2.0","id":67,"result":"0x0000000000000000000000000000000000000000000000000000000000000000"}

IIRC, this was discussed in the recent ACD call, and there seems to be a link for a discussion on the topic: ethereum/pm#330 (comment)

@dwhjames
Copy link

Related to this, trace_rawTransaction exhibits the same error:

GasPriceLowerThanBaseFee { gas_price: 1, base_fee: 491224310953 }

@sunce86 sunce86 self-assigned this Jun 24, 2021
@sunce86 sunce86 added the london label Jun 24, 2021
@salisbury-espinosa
Copy link

salisbury-espinosa commented Jun 25, 2021

try to add "gasPrice"
request:

curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"gasPrice":"0x10000", "to": "0x588Ca95d76c6a7ab121746bd209F2994B7Ba5F10", "data": "0x63a6344e"}, "latest"],"id":67}' http://localhost:8080

response:

{"jsonrpc":"2.0","result":"0x0000000000000000000000000000000000000000000000000000000000000000","id":67}

@KaiRo-at
Copy link
Author

try to add "gasPrice"

Of course that works as a workaround. But that's not what libraries do or should need to do. The curl example I put in the initial comment is just for illustration of the problem.

@yuga-cb
Copy link

yuga-cb commented Jun 28, 2021

FWIW, I am seeing that this can fail even if gas_price is set to something twice as large as the most recent base fee.

RPC call failed: {"code"=>-32015, "message"=>"Transaction execution error.", "data"=>"GasPriceLowerThanBaseFee { gas_price: 2935274, base_fee: 240650928267 }"}

@sunce86
Copy link
Contributor

sunce86 commented Jun 28, 2021

FWIW, I am seeing that this can fail even if gas_price is set to something twice as large as the most recent base fee.

RPC call failed: {"code"=>-32015, "message"=>"Transaction execution error.", "data"=>"GasPriceLowerThanBaseFee { gas_price: 2935274, base_fee: 240650928267 }"}

Sorry, I might be missing something, but how 2935274 is twice as large as 240650928267 ?

@sunce86
Copy link
Contributor

sunce86 commented Jun 28, 2021

Related to this, trace_rawTransaction exhibits the same error:

GasPriceLowerThanBaseFee { gas_price: 1, base_fee: 491224310953 }

Hi,
So, for trace_rawTransaction you can't omit to specify gas_price, and if you specify gas_price then it must be higher then current base_fee.
Please refer to explanation here: ethereum/go-ethereum#23027
In short words, for all RPC functions that work with execution of transactions, there are two options:

  1. You don't specify gas prices => base fee is forced to zero therefore ignored
  2. You specify gas prices => gas prices are validated against current base fee and it must be valid gas prices >= base fee

@yuga-cb
Copy link

yuga-cb commented Jun 28, 2021

FWIW, I am seeing that this can fail even if gas_price is set to something twice as large as the most recent base fee.
RPC call failed: {"code"=>-32015, "message"=>"Transaction execution error.", "data"=>"GasPriceLowerThanBaseFee { gas_price: 2935274, base_fee: 240650928267 }"}

Sorry, I might be missing something, but how 2935274 is twice as large as 240650928267 ?

For this call, we are setting gas_price equal to 2 * the base fee of the most recent block (1467637 * 2 = 2935274). The node seems to think that the base_fee is 240650928267. This could be because we are specifying a block_number in eth_call, and maybe the node is looking at the base_fee of that block_number rather than the most recent block. Regardless, this seems like a bug.

@sunce86
Copy link
Contributor

sunce86 commented Jun 28, 2021

FWIW, I am seeing that this can fail even if gas_price is set to something twice as large as the most recent base fee.
RPC call failed: {"code"=>-32015, "message"=>"Transaction execution error.", "data"=>"GasPriceLowerThanBaseFee { gas_price: 2935274, base_fee: 240650928267 }"}

Sorry, I might be missing something, but how 2935274 is twice as large as 240650928267 ?

For this call, we are setting gas_price equal to 2 * the base fee of the most recent block (1467637 * 2 = 2935274). The node seems to think that the base_fee is 240650928267. This could be because we are specifying a block_number in eth_call, and maybe the node is looking at the base_fee of that block_number rather than the most recent block. Regardless, this seems like a bug.

Yes, the node is always looking at the base fee of the specified block. That is expected.
Anyway, let's revise all this cases once we have the fix.

@sunce86 sunce86 linked a pull request Jun 28, 2021 that will close this issue
@sunce86
Copy link
Contributor

sunce86 commented Jul 7, 2021

FWIW, I am seeing that this can fail even if gas_price is set to something twice as large as the most recent base fee.

RPC call failed: {"code"=>-32015, "message"=>"Transaction execution error.", "data"=>"GasPriceLowerThanBaseFee { gas_price: 2935274, base_fee: 240650928267 }"}

Did you find time to check this issue with the newest release? Can we close this issue?

@KaiRo-at
Copy link
Author

KaiRo-at commented Jul 7, 2021

FWIW, my original issue is fixed with OpenEthereum 3.3.0-rc.3 which I have been using on both Ropsten and Görli since it was released.

@sunce86
Copy link
Contributor

sunce86 commented Jul 8, 2021

PR merged. Closed.

@sunce86 sunce86 closed this as completed Jul 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants