Skip to content

Incorrect block.gaslimit reported #112

@TorstenStueber

Description

@TorstenStueber

The Solidity value block.gaslimit is not the actual block gas limit as reported by the ETH RPC.

How to Reproduce

Deploy the following contract on kitchensink (commit f870555426a40db40788356434c4f11b3d637ea4)

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.20;

contract Test {
    uint256 public recorded_limit;

    function main() public {
        recorded_limit = block.gaslimit;
    }
}

Then call main and then call recorded_limit – this will return the value 2_000_000_000_000 in kitchensink. When requesting the details of the block where the main call was executed from the ETH RPC proxy (e.g., via eth_getBlockByNumber), then the gasLimit reported in that block is completely different, 1_499_336_586_092_000 in my case.

Expected Outcome

The blocks gasLimit should be the same as the value of the Solidity expression block.gaslimit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EVMProblem occurs at the execution stage for EVMPVMProblem occurs at the execution stage for PVMReleaseerror: rpc

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions