0xPolygonHermez / zkevm-node

Go implementation of a node that operates the Polygon zkEVM Network
Other
531 stars 685 forks source link

RPC `eth_call` not executing transaction in the block specified #3526

Closed krlosMata closed 5 months ago

krlosMata commented 5 months ago

System information

zkEVM Node version: v0.6.4 OS & Version: Linux Network: Cardona

Expected behaviour

eth_call takes as a parameter the blockNumber as a parameter in order to execute the payload on a specific blockNumber. Tx being executed in the blockNumber provided

Actual behaviour

Looks like this is not happening in the node since transaction is always being executed in the latest block number

Steps to reproduce the behaviour

SC deployed:

// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

contract GetBlockHash {
    function getBlockTimestamp() public view returns (uint) {
        return block.timestamp;
    }
}

eth_call using cast:

cast call --rpc-url https://rpc.cardona.zkevm-rpc.com 0xDE12c2E97562Bbbd13e168256E5905A8432d92C5 "getBlockTimestamp()" -b 1982744 | cast to-dec

The above command should return always the same timestmap, but instead it returns always the latest one

returns always the same timestamp, which is the timestamp of the specified blockNumber