0xPolygonHermez / cdk-erigon

Ethereum implementation on the efficiency frontier
GNU Lesser General Public License v3.0
32 stars 31 forks source link

Bug estimating gas for previous blocks to the deployment of the smart contract #1230

Closed ARR552 closed 3 days ago

ARR552 commented 4 days ago

Bug estimating gas.

curl --location --request POST 'https://zkevm-rpc.com:443' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_estimateGas",
    "params": [
        {
            "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
            "to": "0x0129fA709E362a708ea51cD6549110c265f0FC9a",
            "value": "0x0",
            "data": "0x04e960d79d204125586682b92191d3dc0f6fd58138179cc945009490ec217cb0704a2fc08d8de5804100c5d09cb25bba2e7baec6eda1ddb0da0a92775a407c257dc9425ebe0851a9e1cbcebdb500ec5001a042bf5359662fc5a1282f28ed6245e63415d2640c5cacef387563d0b105c7724c45ee19f8a952cb583de494a6a7ce5ed16760142b33cbf8255e9f0628ab9e250e179a3e7e8e24e0a2a4340f0b9fdeb29a1b48"
        },
        "0xF8909E"
    ],
    "id": 1
}'

Doing this call in block 1 (before the smartcontract deployment) I still get the same estimation. The correct behaviour should be: If the contract was already created, the gas estimation is the result of the execution. If the contract wasn't created, the result is the cost of send a regular tx with value 0 and some data to store in the ledger