platform icon indicating copy to clipboard operation
platform copied to clipboard

JSON-RPC `eth_call` is not handle its block parameter properly.

Open o-p opened this issue 3 years ago • 2 comments

Problem Description

description:

JSON RPC eth_call API always returns the latest block result even I specified the block parameter.

Screenshots:

This is Multicall::getCurrentBlockTimestamp() result of Findora mainnet, the result timestamp is close to current timestamp (2022-05-23T06:51:54.000Z) image

This is the same eth_call but specifies block to the next block after Multicall contract is deployed. The expected result is close to 62181de8 (2022-02-25), but it returns current timestamp (2022-05-23). image

Compare to other network, it response the timestamp at the block height or "header not found"

image

Environmental information

Code version:

findora-web3-engine/1.55.0-amd64-linux

Steps to reproduce

curl --request POST \
  --url https://prod-mainnet.prod.findora.org:8545/ \
  --header 'Content-Type: application/json' \
  --data '{
	"jsonrpc": "2.0",
	"method": "eth_call",
	"params": [
		{
			"to": "0x69dCF8266fb48537737A32a9850137B291Ee62ad",
			"data": "0x0f28c97d"
		},
		"0x1bbc79"
	],
	"id": 5566
}
'

o-p avatar May 23 '22 08:05 o-p

2 points:

  1. eth_call on history state requires an archive node (now we supports queries to old state for balanceAt, storageAt, transactionCount). eth_call to old state(needs to point to an old state) is not implemented(needs research, design) now. Compared to other network, it's better to return "header not found" if not supported?
  2. Are you trying to test something out? Do you have any work around in your mind?

ws4charlie avatar May 24 '22 01:05 ws4charlie

JIRA task created: https://findora.atlassian.net/browse/FO-996

ws4charlie avatar May 25 '22 16:05 ws4charlie