sei-protocol / sei-chain

Apache License 2.0
2.67k stars 797 forks source link

[BUG] estimateGas dosen't check the block's max-gas #1739

Closed JoowonYun closed 1 week ago

JoowonYun commented 1 week ago

Seid version

Chain ID

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

curl https://evm-rpc-arctic-1.sei-apis.com \
  -X POST \
  -H "Content-Type: application/json" \
  -H "x-qn-api-version: 1" \
  --data '{
    "id":13,
    "jsonrpc":"2.0",
    "method":"eth_estimateGas",
    "params":[{"data":"0x07a8399c0000000000000000000000000000000000000000000029ff291e4bba59715eee0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000816271999a4f81662ba24665dc2e5ec2470547e100000000000000000000000000000000000000000000000000000001cc15d1650000000000000000000000000000000000000000000000000000000000000002000000000000000000000000027d2e627209f1ceba52adc8a5afe9318459b44b000000000000000000000000a46a7b3c0a43875b7c9f2064670e600e845e58cf","from":"0x144Ae3d96199735821032C5aA90C775B17b28c5E","to":"0xcfcdC98Bf3513D6cb3dE231Da6cA02dDA0F518a5","value":"0x16bcc41e90000"}, "latest"]
  }'
{"jsonrpc":"2.0","id":13,"result":"0xa12ea0"}

-> "0xa12ea0" is 10563232. So it's more than block max-gas(10000000)

Expected behavior A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

JoowonYun commented 1 week ago

I see that the default value is already the correct value. https://github.com/sei-protocol/sei-chain/blob/35a7bf03c38ac5ec9875ee75dab0280fdeda1972/evmrpc/config.go#L99